Search
Enter Keywords:
Sunday, 05 September 2010
Home
X Forwarding Over SSH PDF Print E-mail
Written by Clint Christopher Canada   
Ever needed a gui based program to run over a remote server?  There are many ways to do this, but one nice way to do it is through ssh.

If you're looking for a nice tutorial for doing this, look no further... you've come to the right place.
How do we do it?

Here are the steps:

1. Make sure that X Forwarding is enabled on the remote ssh server.  Add these lines to your sshd_config file located in the /etc/ssh directory:

X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes

DisplayOffset can be changed to whatever screen you desire (default is 10)

2. Restart your ssh server.  This is done by running /etc/init.d/sshd restart for Fedora/RedHat based systems or /etc/init.d/ssh for Debian based systems.
3. If you're running ssh in a command line, type in the following:

ssh -l username -p 22 -X -C domainname.com
Here are the meanings of the parameters:
l - username
p - port number of the server (not needed if your port address is standard)
X - use X forwarding
C - use compression.  This allows better performance, especially if your remote server is quite far.

4. If you're using putty, set up X forwarding as shown here:

putty X11 Forwarding

Also, enable compression here:



5. Connect to the server.  When you do:
#echo $DISPLAY
your $DISPLAY variable should come up as:
localhost:10.0

6. Fire up your local X server.  On windows machines you may use Cygwin/X or my personal favorite X-deep/32 (there is a freeware version of this software, which is an older version, but you have to search through google to find it).  Make sure you have the screen display set to :10 or whatever you set up in sshd_config.

7. To test if it works, type in the following in the remote server:
#xterm &

If you see your xterm window up, congradulations!  You've now got X Forwarding over ssh

Next >

Cegnulug Groups
  • Documentation services Just want to let list members know that I have a small informal group that can offer technical documentation services. The members of the group are all
  • OT - Magento guy needed per project Peace! Hi guys, OT - I am needing someone who can fill in doing some Magento (open source php shopping cart) customizations per project basis. Requirement: one
  • Re: Meet Up with the newbies.. Hello Richard, Estimated more or less 20 person... the more the merrier :) regards, Jerald
  • Re: Meet Up with the newbies.. Hi Jerald/All Unfortunately I can't help with the venue as I'm not connected with them anymore. Think we need a bigger space eh ? Jerald just how many
  • Meet Up with the newbies.. Dear Group, What: Meet up with the newbies and other linux group when: September 18, 2010 @ 6pm onwards Where: Lets discuss this.. Agenda: This will be the


Mambo is Free Software released under the GNU/GPL License.