Monday, March 7, 2011

Linux and SSH

Sometime ago I built myself a media server. This is a Linux box running Xubuntu and setup to stream media to the XBox 360, the Western Digital Media Player and connected to the audio in on the stereo. I searched and searched for a good howto so I could setup VNC on my server so I could control the media player. In this instance, GMusicBrowser, just because it is light weight and quick.
Then it dawned on me.... What am I doing??? I could use ssh and X11 forwarding. 
So that is what I did. 
I already had opensshserver installed on my server. X forwarding is enabled by default. So no config to mess with. 
Just simply log into the server using a command such as this:
ssh -X username@192.168.1.12 (Note that is a capital "X")
Then while connected just type in the name of the app you want to run. In this example it was gmusicbrowser. The app opened up on my local laptop and the output went to the stereo. 
That was all it took.
Here is how you can accomplish the same thing.
Once you have Ubuntu installed and patched, run this command:
sudo apt-get install tasksel
Followed by 
sudo tasksel
When you run tasksel you will get a box opened up in your shell. 
Using the arrow keys scroll down to openssh server.
Select this by pressing the space bar.
Then tab to OK and press enter.
This will install the needed packages to make your Ubuntu computer accept ssh connections.
This is all you need to do. Then you can go to your other computer and connect using a command just like the once I used above. 
ssh -X username@192.168.1.12
If you have a firewall enabled you will need to make sure that port 22 is open to allow your ssh traffic to your server.
That's it, you're all done and ready to run some apps.

No comments:

Post a Comment