On 31/10/10 18:57, Seb wrote:
Hi, I use SSH to connect to a laptop computer that is in an institutional network. I would like to set an entry for it in my local /etc/hosts, so that I don't have to type the IP address every time I want to connect to is and simply use an alias. As per the man page, /etc/hosts has:
Why don't you just use the ~/.ssh/config file to name the access you want. Not only can you give each entry and name you want, you can then specifiy which set of keys to use (so you can use different keys for different hosts).
The following is just one entry I use to access an account on a remote server at a hosting company. I access it with just the two letters mb (or mb: depending on the context)
Host mb HostName example.com User mel2 IdentityFile ~/mydocs/PCinfo/keys/mb.com/mel2 For example to rsync some data to that machine I do rsync -a /path/at/this/end mb:path/at/that/end see man ssh_config for the full set of options. -- Alan Chandler http://www.chandlerfamily.org.uk