SSH Trick
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
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
One Response to “SSH Trick”Trackbacks
Check out what others are saying about this post...[...] friend of mine just recently posted a trick with long hostnames when using SSH. I have commented before many times when I see people making aliases or [...]