Stupid ssh Tricks

Despite getting distracted for a few day with the whole Hackintosh thing, I am closing in on the end of my Linux+ training. Today I got to the remote access section and ssh. Both of the books I have just cover basic installation and login, nothing fancy. However there are quite a few things that can be done with ssh. For instance If I wanted to play a movie on my media center with out getting up from the couch I could do this with ssh. Once logged in to my media center from my notebook I issue:

$ export DISPLAY:0

$ vlc -f –dvd

to play a dvd, or;

$ vlc -f

to watch the Monty Python Crunchy Frog sketch.

This next trick, X forwarding, isn’t particularly secure, so don’t use it over an unsecured network (such as the internet). I find it works well for controlling the media player from my couch. First make a ~/ssh/config file on the ssh server with these contents:

ForwardX11 yes
Protocol 2,1

Then log in with the -X switch like this:

$ ssh -Xl user media.centers.IP.addr

Of course substituting user with the login name where you put the ~/ssh/config file, and media.centers.IP.addr with the IP address of your media center PC. Then when you launch an X client program on the server the interface is forwarded to your client computer while actually running on the server. In my case;

$ exaile

launches the exaile media player on my media center(ssh server) but forwards the interface to my (ssh client) notebook. I can then controll the playlist, volume and everything else without getting up from the couch.

Hey, I did call them stupid ssh tricks.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s