Is there a way to define host aliases (like in /etc/hosts
) on a per user basis, i.e. in a file /home/user/.hosts
?
My primary objective is to easily share host aliases via rsync between the machines in my small lan. Since there is no machine that will be reliably always connected, a DNS server is not an option (right?).
Thank you.
alias ssh="ssh "
in your .bashrc (note the trailing whitespace at the end of the alias) along withalias myhost="[email protected]"
and then you can sayssh myhost
and it will work.~/.ssh/config
where you add the lines:Host my-host
andHostname 10.0.0.xxx
<-- IP of the machine. The nice thing is it also allows you to specify username, port, which key to use etc