Last active
June 14, 2017 04:28
-
-
Save zhangchenchen/c9f8fe32e9cc5bc91d5294781424bb06 to your computer and use it in GitHub Desktop.
salt command to ssh login with private 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
| salt '*' cmd.run 'mkdir ~/.ssh && chmod 700 ~/.ssh' | |
| salt-cp '*' ~/.ssh/id_rsa.pub ~/.ssh/temp.pub | |
| salt '*' cmd.run 'cat ~/.ssh/temp.pub >> ~/.ssh/authorized_keys && rm -f ~/.ssh/temp.pub' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment