Add your public key to a remote ssh account

Tagged with ssh

Language: Bash

I always forget this handy shortcut so I’m putting it up so I can find it later. Perhaps it will help you too.

View as text

cat .ssh/id_rsa.pub | ssh user@domain.tld 'cat >> .ssh/authorized_keys'
Original snippet written by Brian Hogan
Last updated at 13:50 PM on Mar 03, 2009 by Brian Hogan

SnippetStash costs money to host and develop. The service is free for everyone to use
but if you found it useful please consider making a small donation.