To login to remote hosts via ssh without having to type your password all the time, one way is to use Public Key authentication. The easiest way is to copy from your client machine the public key, for instance the contents of ~/.ssh/id_rsa.pub, into the .ssh/authorized_keys of the remote host. To do this use the special utility ssh-copy-id:

ssh-copy-id stathis@remote.host.com

One of the problems I encountered is when you try to use this utility with a remote ssh server that is not listening on the default port. To use a different port use the following syntax:

ssh-copy-id '-p 2222 stathis@remote.host.com'
0