随笔分类 - 脚本
摘要:#清除ssh cd ~/.ssh; rm -rf id_rsa; rm -rf id_rsa.pub; rm -rf authorized_keys; #生成密钥 expect << ooff set timeout 60 spawn ssh-keygen -t rsa expect { "Ente
阅读全文
摘要:set timeout 60 spawn ssh root@master expect { #首次连接 "(yes/no)?" {send "yes\r";exp_continue} "password" {send "root\r"} } expect "~]#" {send "echo 192.
阅读全文