Sunday, March 6, 2011

How to give name to a remote host in ubuntu

If you often use ssh, scp and programs that require a host and the host is an ip address you would appreciate this post.

You can give a local name to a ip address adding a record in the /etc/hosts file
sudo gedit /etc/hosts
add a line suck as 123.123.123.123 [tab to separate address from name] hostwhoseipidontremember

now if you used to type ssh 123.123.123.123 now you can type ssh hostwhoseipidontremember with the same results