Return to Snippet

Revision: 22926
at January 26, 2010 03:13 by berkes


Initial Code
ssh user@host 'mkdir ~/.ssh; echo '`cat ~/.ssh/id_dsa.pub`' >> ~/.ssh/authorized_keys'

Initial URL
http://snippets.dzone.com/posts/show/2335

Initial Description
Instead of ~/.ssh/id_rsa.pub, you can choose any location on your local machine where your *public* key lives.
You may need to adjust the file permissions on remote authorized_keys aftwterwards, depending on the configuration of the remote ssh server.

Initial Title
Oneliner to add a public key to a remote servers authorized-keys

Initial Tags
ssh

Initial Language
Bash