Skip to content

Instantly share code, notes, and snippets.

@aqzlpm11
Last active January 23, 2018 08:32
Show Gist options
  • Save aqzlpm11/aada8722930ef0054e50fa8344ca31be to your computer and use it in GitHub Desktop.
Save aqzlpm11/aada8722930ef0054e50fa8344ca31be to your computer and use it in GitHub Desktop.
远程添加ssh-key
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