2008年7月4日

Config Ubuntu to enable Open-SSH X11 Forwarding

In server-side, edit "/etc/ssh/sshd_config" file, check settings below:
X11Forwarding yes
X11DisplayOffset 10


Default settings in Ubuntu hardy are X11 forwarding enabled, because of the X11Forwarding is set to yes.

If the configuration file modified, please reload sshd using "/etc/init.d/ssh restart" command.

Parameters must added when client-side using ssh command to connect remote host, two commands below will establishing X11 forwarding connection.
  • ssh -Y user@remote_hostname
  • ssh -X -C user@remote_hostname
Description of parameters is shown below.
-X Enables X11 forwarding.
-Y Enables trusted X11 forwarding.
-C Requests compression of all data.

If something was wrong, there will be some error messages when execute X11 applications on remote host, like "xclock", messages maybe like:
Error: no display specified
To solve this problem, using "ssh -X -v user@remote_hostname" to show all debug messages. This provide information like:
debug1: Remote: No xauth program; cannot forward with spoofing.
The sample error message tell us need to install "xauth" on remote host. It's a program X11 forward required. Just type "apt-get install xauth" to perform installation.

沒有留言:

張貼留言

lyhcode by lyhcode
歡迎轉載,請務必註明出處!