The beauty of the ssh config file

         ·     

This is a tip that I have used on OS X and on Linux, which I presume works on other *nix and BSDs using SSH.

Basically in the .ssh folder in your home directory you can create a file called config with which you can put all sorts of configuration information for your ssh client but the real benefit for me was to use this to give extra information to hosts such as defining a different port number to connect on. For instance:

<br /> Host myservername<br /> User myuser<br /> Port 22222<br />

This means that instead of typing:

<br /> ssh -p 22222 myuser@myservername<br />

I can type:

<br /> ssh myservername<br />

No need for nasty aliases in the shell or anything like that. This also works for the sshfs program on the Mac that makes use of MacFuse. Yes that’s right you can use different ports with SSHfs.

You can also change a much wider range of parameters than I have shown here, but often its probably better to introduce them on the server. But here is an example and have a look under the options flag in the Man page for SSH

<br /> Compression yes<br /> CompressionLevel 9<br /> FallBackToRsh yes<br /> KeepAlive no<br />

comments powered by Disqus