Wednesday, October 22, 2008

Open desktop environment througth ssh

This post will show you a very simple way to open a desktop environment such as gnome, kde or xfce through ssh. This way has been tested on Ubuntu and Kubuntu.



Step 1:
You need to install open ssh client and server

sudo apt-get install openssh-client openssh-server

Step 2:
On the client machine you need to open a new screen. In order to do this press Ctrl+Alt F2 (or any f2-f6) and login.

Step 3:
When you are logged in run following command to open a new X Session in screen 1 (you can open it in other screens ex. 2. If you want to go to another screen press Ctrl+Alt f8 - f12)
xinit /usr/bin/xterm -- :1
When the session is opened you will only see a terminal.

Step 4:
On that terminal you will execute this command to open an ssh connection.
ssh -X username@host_ip
or
ssh -Y username@host_ip
The difference between the above commands is that the first one is subjected to X11 SECURITY extension restrictions by default. The second is not. So it is advised to use it with caution.

Now you have to enter your password (from your account on the server) in order to login.

Step 5:
When you are logged in the remote computer according to the X environment it has installed you have to enter the following to run it.

For machines with Ubuntu usaly:
gnome-session
or if you have KDE installed type :
startkde
For machines that have XFCE installed type:
startxfce4


No comments: