Geekblok

B10m, BOK, Joffie - old geeks on a blog

Entries Comments



Ssh tips and tricks, part 1

15 October, 2007 (17:00) | guides, technical | By: Joffie

Most people use ssh only as a secure shell version of telnet. This is a somewhat limited view of the real power of ssh. One can use ssh for so much more. On request of B10m I’ll start writing a few entries on this subject. Most of the time I am using openssh for this, but the tricks will probably work on other versions of ssh too.

puf100X86.gif

I noticed that most people use ssh like this: ssh -l joffie example.net. This works of course, but can also be written as: ssh joffie@example.net.
Or, when your username on your local system is also joffie, as: ssh example.net. If that is not the case there is also the trick of putting the username in your ssh config file: ~/.ssh/config, by default:

bq. $ cat ~/.ssh/config
Host example.net

User joffie

One can even put an alias for the host in the config file:

bq. $ cat ~/.ssh/config
Host X

Hostname example.net

User joffie

With the above config file a ssh X will log user joffie in to the server example.net.
There are a lot more options of ssh and in following articles I’ll explain some more.