Actually following command not only perform copying ssh public key to remote machine but also remove authorized_keys and known-hosts old files simultaneously.
cat ~/.ssh/id_dsa.pub |ssh root@remote_machine 'sh -c "cat - >>~/.ssh/authorized_keys2;rm ~/.ssh/authorized_keys;rm ~/.ssh/known_hosts"'
Tuesday, February 2, 2010
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment