Reputation: 170698
I am looking for the simplest set of commands you can run for adding your public key to the authorized_keys files of the root account on a remote server.
We assume that the current user has login access to the remote server and it is also listed in the sudoers file.
Running the command twice should have no effect.
Upvotes: 5
Views: 8896
Reputation: 930
How about running the ssh-copy-id command? Man pages says the following:
ssh-copy-id - install your public key in a remote machine's authorized_keys
Sounds exactly what you're looking for? I have never tried running the command twice, though. It may not check for that.
Upvotes: 9