Created
August 16, 2018 02:27
-
-
Save ljjjustin/c05a8f1117ace45813b3fd9696769752 to your computer and use it in GitHub Desktop.
bootstrap 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
| #!/usr/bin/expect -f | |
| set host [ lindex $argv 0 ] | |
| set timeout 10 | |
| set password xxxxxx | |
| spawn ssh-copy-id root@${host} | |
| expect { | |
| "(yes/no)" { send "yes\r"; exp_continue } | |
| "password:" { send "${password}\r" } | |
| } | |
| expect eof |
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
| LogLevel error | |
| ServerAliveInterval 30 | |
| ServerAliveCountMax 6 | |
| StrictHostKeyChecking no | |
| UserKnownHostsFile /dev/null | |
| IdentityFile ~/.ssh/id_rsa | |
| Host * | |
| ForwardAgent yes | |
| ControlMaster auto | |
| ControlPersist 600 | |
| ControlPath ~/.ssh/sock_%r@%h_%p |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment