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

/ Published in: Bash
Save to your folder(s)

Instead of ~/.ssh/, 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.

Copy this code and paste it in your HTML
  1. ssh user@host 'mkdir ~/.ssh; echo '`cat ~/.ssh/`' >> ~/.ssh/authorized_keys'


Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.