24 Haziran 2011 Cuma

Enabling remote X-windows

konsol ile baglandiktan sonra direk
$ ssh -X host
komutunu calistirark xwindowlu tum uygulamalari yonlendirebilir yada

This will set the DISPLAY variable automatically and any X program you run will be automatically tunneled back through the ssh connection.

Otherwise we're going to need to enable it. Here's how:

1. Go to System->Administration->Login Window (or run gdmsetup as root)
2. Under the security tab uncheck "Deny TCP connections to Xserver"
3. Now we have to restart gdm which will kill our Xsession.
# kill -HUP `cat /var/run/gdm.pid`

or if you prefer to edit /etc/gdm.conf by hand, make sure there are no overriding settings in /etc/gdm.conf-custom. Under the security section change DisallowTCP to false.

Unfortunately we cannot use gdmflexiserver, only a gdm restart will work.



Remotely Displaying an Ubuntu Linux Application

The first step in remotely displaying an application is to move to the system where the application is to be displayed. At this system, ssh into the remote system so that you have a command prompt. This can be achieved using the ssh command. When using the ssh command we need to use the -X flag to tell ssh that we plan to tunnel X traffic through the tunnel:


ssh -X user@hostname

where username is the user name to use to log into the remote system and hostname is the hostname or IP address of the remote system. Enter your password at the login prompt. Once logged in, run the following command to see the DISPLAY setting:


echo $DISPLAY


The command should output something similar to the following:


localhost:10.0

To display an application simply run it from the command prompt. For example:


xclock

When run, the above command should run the xclock utility on the remote system, but display the output on the local system:


xclock&

[edit] Trusted X11 Forwarding



If the /etc/ssh/ssh_config file on the remote system contains the following line, then it is possible to use trusted X11 forwarding:


ForwardX11Trusted yes

Trusted X11 forwarding is slightly faster than untrusted since it does not engage the X11 security controls. The -Y flag is needed when using trusted X11 forwarding:


ssh -Y user@hostname

[edit] Compressed X11 Forwarding


When using slower links the X11 data can be compressed using the -C flag:



ssh -X -C user@hostname