What is the best method for editing the /root/.ssh/authorized_keys file?
I mean if I need to append a new key to my authorized_keys file, than what are the best methods to do that?
What is the best method for editing the /root/.ssh/authorized_keys file?
I mean if I need to append a new key to my authorized_keys file, than what are the best methods to do that?
Try just to edit the file and paste key on the end.
You want automated? Try from server where you want to add key to do:
ssh-copy-id -i id_rsa.pub login@hostname
You can always try ssh-add on the server where you have an authorized_keys file stored.
Plenty of opportunities :D
Each line is an independent entry. You can grep them to filter, sed -i~ /pattern/d authorized_keys to delete lines, say all those from some server, or cat new-entries >> authorized_keys to add lines to the end.