SUSE机器添加互信
#!/bin/bashnum=1nump=”$num””p”for i in ‘cat ip.txt’doecho “ip:”$ipaswd=’sed –n “$nump” paswd.txt’echo “passwd:”$paswd/usr/bin/expect <<EOFset timeout -1spawn ssh-copy-id –i /root/.ssh/id_rsa.pub root@$iexpect “*(yes/no)?” {send “yes/r”}expect “*PassWord:” {send “$paswd/r”}expect eofEOFLet num++nump=”$num””p”donecentOS机器添加互信
#!/bin/bashnum=1nump=”$num””p”for i in ‘cat ip.txt’doecho “ip:”$ipaswd=’sed –n “$nump” paswd.txt’echo “passwd:”$paswd/usr/bin/expect <<-EOFspawn ssh-copy-id –i /root/.ssh/id_rsa.pub root@$iexpect “*Password:” send “$paswd/r”expect eofEOFLet num++nump=”$num””p”done
新闻热点
疑难解答