User specific /etc/hosts files?

Use a ~/.ssh/config file with something like

Host my-machine

User me

HostName 192.168.63.1

This way, you can even skip the "me@" and do just "ssh my-machine"


This is how I handle it...

In .bash_aliases

alias myhomepc='ssh [email protected]'
alias mydevpc='ssh [email protected]'

And then just use it like so:

myworkpc:~ $ myhomepc
Password: 
Last login: Mon Sep 21 15:54:04 2009 from 111.222.333.445
myhomepc:~ $

Using a service like dyndns mentioned above is really handy as well.


What OS are you on specifically? Alternatively, if your router supports DDNS you can register with Dyndns.org and get a free domain name from them. The router will automatically update their record for your domain when the IP changes.