利用shell脚本通过ssh绕过输入密码直接登录主机详解程序员

shell

#!/usr/bin/expect 
spawn ssh [email protected] 
expect "*password:" 
send "lizhenghua/r" 
expect "*#" 
interact

需要安装expect, 如果执行失败

yum install expect -y

原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/2930.html

(0)
上一篇 2021年7月16日
下一篇 2021年7月16日

相关推荐

发表回复

登录后才能评论