Deploy SSH key to remote server using ssh-copy-id

This is how to quickly deploy a SSH public key to a remote linux server. Afterwards automation tools like ansible, chef or puppet should be used.

AWS is a good opportunity to easily setup your infrastructure. A SSH key can be managed using the AWS Key-Management.
But other (less expensive) cloud provider send out initial SSH passwords. Here is how to avoid too many manual steps.

Using commands

This will grab the first public key (*.pub) found in the ~/.ssh directory and transfer it to the remote host.



Leave a Reply

Your email address will not be published. Required fields are marked *