ITPub博客

首页 > 应用开发 > IT综合 > 使用expect自动自动登陆ssh和telnet

使用expect自动自动登陆ssh和telnet

原创 IT综合 作者:liang573728 时间:2019-03-09 19:45:05 0 删除 编辑
使用expect自动自动登陆ssh和telnet[@more@]

cat de03
#!/usr/users/nmds/bin/expect -f

set timeout 30
spawn telnet dw03
expect "login:"
send "nmdsr"
expect "Password:"
send "12345r"
interact

=============

cat dw01
#!/usr/users/nmds/bin/expect -f

set timeout 30
spawn ssh -lelink dw01
expect "password:"
send "12345r"
interact

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/640706/viewspace-1048336/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2005-10-15

  • 博文量
    152
  • 访问量
    138345