Last active
January 23, 2018 08:32
-
-
Save aqzlpm11/aada8722930ef0054e50fa8344ca31be to your computer and use it in GitHub Desktop.
远程添加ssh-key
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh-copy-id -i ~/.ssh/id_rsa.pub [email protected] | |
user=root | |
remote_addr=192.168.0.1 | |
scp ~/.ssh/id_rsa.pub $user@$remote_addr:/tmp/pub | |
ssh -l $user $remote_addr "cat /tmp/pub >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment