Site icon Leonid Mamchenkov

Copy SSH key to remote machine

Those of us who use secure shell (SSH) for logging in to remote machines, already know about key authentication, which is so much easier and sometimes more secure than password authentication.  We also know that in order to make it work you need to:

And that’s just what we have been doing.  Or at least me.  Today, after approximately 10 years of using secure shell, I’ve learned that there is a ssh-copy-id command, which will automatically add your current public key to a remote machine’s authorized_keys file and arrange for correct permissions.   Wow!

Thanks to @commandlinefu and top 10 one-liners blog post.

Exit mobile version