Publishing Date: Monday, January 18 2010
emerge opensshOnce installed, we will edit the configuration file for both the server and the client.
nano /etc/ssh/sshd_configAdd the following lines to the end of the config file:
X11Forwarding yesThen edit the configuration file for the client:
X11DisplayOffset 10
X11UseLocalhost yes
nano /etc/ssh/ssh_configAdd the following lines to the end of the config file:
ForwardX11 yesOnce done, start the SSH daemon:
/etc/init.d/sshd start(Note if already started, you need to restart it so that the config changes are reflected in the service: /etc/init.d/sshd restart)You may install the following which we will also use for testing purpose:
emerge xclock xterm xcalc xlogo xedit xloadThe next thing you need to know is what is your external IP. You can find this simply by going to whatismyip.com. You may also set up an account for yourself on dyndns.org so that you don't have to find out your server ip address everytime.
ssh [your ip address] -XAfter some security prompts (key and password), you should be able to see your remote shell. You can do pretty much everything over here. To check graphical applications, enter the following:
xclockAfter a while (depending on your net speed), you should be able to see a clock display on your desktop. Congratulations. You can also try the rest of the tools you installed
xtermLet's test something else which is complicated. If you have firefox on your remote machine, fire up firefox
xcalc
xedit
firefoxAfter a brief while, you will see Mozilla firefox just like the remaining GUI tools. Unfortunately, the environment you will see here will still be your local client environment. (For example, if we give an address 192.168.*.* of any local computer on the remote network, it will fail to show up). To work around this, we are going to try something different. Press CTRL+ALT+F2 on your client and you will be forwarded to a non-X login prompt. Login with your username and password and enter the following at the shell:
xinit -- :1 vt8This will create a new graphical shell on F8. The previous graphical shell always runs on F7. To see what we have got, press CTRL+ALT+F8 and you should be able to see an xterm window. You can shift back and forth between both shells (CTRL+SHIFT+F7 and CTRL+SHIFT+F8). Fire up ssh from the new graphical shell in the same manner:
ssh [your ip address] -XOnce you are connected, you may need to load up a window manager to make things easy for you. Type:
mwm &on the remote shell. This is the motiff window manager and you have run it as a background process. If you have a good internet connection you may also try "gnome-session" or any other desktop environment instead of "mwm". Now enter:
firefox &Once firefox loads, you can access your local computers just as if you were on the remote site. A way of putting this to good use is configuring your router (which are typically loaded on 192.168.1.1 from the browser). Of course you may configure remote access on your router as well but that is a different thing.

Comments powered by Disqus