random technical thoughts from the Nominet technical team

Running Remote X Sessions

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...
Posted by jason on May 19th, 2005

Every server we access here is via ssh. On occasion I need to run X on a server and display this back to my desktop. In the past I have been doing this insecurely due to NOT tunnelling my X session over ssh, I would have to mess around setting xhost + on the local machine and setting the DISPLAY variable on the remote server.

So to securely run a remote X session ensure you have the following set in both ssh_config on your LOCAL machine and in sshd_config on the remote server

ForwardX11 yes

Interestingly when you log in to the remote server you should see your display automatically set to:

localhost:10.0

Final tip is that if you ssh as user A but want to run a remote X session as user B, copy the

~/.Xauthority

From yourself to the user you are interested in and manually set your display variable:

export DISPLAY=localhost:10.0

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.

Recent Posts

Highest Rated

Categories

Archives

Meta: