!/bin/bash
ip=10.0.112.144
pass=centos
if test ! -e /root/.ssh/id_rsa
then
ssh-keygen -t rsa -f /root/.ssh/id_rsa -P “”
fi
/bin/expect <<EOF
spawn ssh-copy-id -i root@KaTeX parse error: Can't use function '\r' in math mode at position 43: …o)?" {send "yes\̲r̲";exp_continue}…pass\r"}
}
spawn ssh root@KaTeX parse error: Can't use function '\r' in math mode at position 43: …o)?" {send "yes\̲r̲";exp_continue}…pass\r"}
}
expect eof
EOF
有待改进,刚学
ssh 自动链接 shell 练习脚本
最新推荐文章于 2024-07-30 08:38:09 发布