Post thumbnail of Add your public SSH keys to a remote host’s authorized_keys in a single command
14 November 2008
Continue reading Add your public SSH keys to a remote host’s authorized_keys in a single command

Add your public SSH keys to a remote host’s authorized_keys in a single command

[user@localhost ~]$  cat ~/.ssh/id_rsa.pub ~/.ssh/id_dsa.pub | ssh user@remotehost ’sh -c “cat - >> ~/.ssh/authorized_keys”‘
You’ll be prompted for the password just this one last time.  This is perfect for running a script that runs several remote commands through ssh.  Here’s a script that checks for your keys and adds them if …

Powered by Wordpress   |   Lunated designed by ZenVerse