X11 forwarding over SSH
Sunday, May 28, 2006 by Nate Murray.
Setting up X11 port forwarding via SSH is a pretty simple task. Here is how to do it between a Slackware and Mac OSX machine. The process should be general enough to expand other *NIX machines. The first step is to setup your sshd to forward X11.
*On the server machine (Linux in this case) add the following line to
/etc/ssh/sshd_configX11Forwarding yes
*Also in /etc/ssh/ssh_config add these lines:
ForwardAgent yes ForwardX11 yes
*Then as root restart sshd:
root@slackware# /etc/rd.d/rc.sshd restart
Running an Application from the Mac
- Then startup /Applications/Utilities/X11.app on the Mac.
- Open up an xterm and type the following commands:
user@slackware: ssh -X user@slackware user@slackware: echo $DISPLAY :10.0 user@slackware: xclockNotes:
- The -X tells ssh to forward X11.
- If you do not get a reponse when you echo $DISPLAY you do not have the X11 forwarding setup correctly.