SSH Trick

April 7, 2010   

To start off with.. I know you can do this in DNS using a search parameter but I don’t want to do that in my envirnoment.

Sometimes you are working with a hostname that is long due to the domain name. This is the case where I am currently working, the domain is theopenskyproject.com. So I did the following and added into my ~/.bashrc

function ssh() { /usr/bin/ssh $1.theopenskyproject.com; }

You can now do the following

ssh node1<br /> ssh user@node1

Right now its pretty simple. Flags won’t work with ssh. If you want you can make it more shorthand by calling the function s



comments powered by Disqus