1 view

First generate the ssh key, then use the below command to copy to the remote server,

ssh-copy-id -i ~/.ssh/id_rsa.pub USERNAME@remoteserver

This will ask for password of remote server, enter it once. If copy id succeeded, it wouldnt asked again for future logins!

ssh copy id can be used for login to any username, for example, the same id can be used for:

ssh-copy-id -i ~/.ssh/id_rsa.pub USER100@remoteserver
ssh-copy-id -i ~/.ssh/id_rsa.pub USER220@remoteserver
ssh-copy-id -i ~/.ssh/id_rsa.pub USER770@remoteserver

and so on.. when connecting next time, provide the username you want to use in the remote server.

Welcome to Ask DevOps!
You can find quick one line answers to popular DevOps, Amazon AWS, Microsoft Azure, Google cloud services, tools & basic to advanced Linux questions!
DevOps Tools list