-
create public and private keys on client host:
ssh-keygen
, when asking for passphrase, press enter directly. This will create public key file(~/.ssh/id_rsa.pub) and private key file (~/.ssh/id_rsa); -
copy public key to remote ssh server:
$ ssh-copy-id user@remote_server
This will add the public keys of user@client_host into $HOME/.ssh/authorized_keys on the remote server. If ssh-copy-id complains "No identities found", you have to specify the identity file (your public key) manually:
$ ssh-copy-id -i ~/.ssh/id_rsa.pub user@remote_server;
Now you can login remote server with ssh user@remote_server
without entering password.
If you want auto-login another remote server, only ssh-copy-id is needed.
If later the remote_server won't trust client_host anymore, just delete the pub key line in /home/user/.ssh/authorized_keys on remote_server.
If you want the help of your partner Bob on the remote server, let him login to it, you needn't tell him the password, just add his pub key into the server. After Bob finish his job, delete his pub key on the remote server.