Linux expect 使用简介
一.登陆到远程主机

脚本代码如下:

##############################################
#!/usr/bin/expect
set timeout 30
spawn ssh -l username hostip
expect { 
"yes/no" { send "yes\r";exp_continue } 
"password:" { send "hostpassword\r" } 
} 
interact
##############################################
View Code

相关文章:

  • 2022-12-23
  • 2021-12-17
  • 2021-08-22
  • 2021-11-30
  • 2022-01-07
  • 2021-06-29
  • 2022-01-03
猜你喜欢
  • 2021-12-10
  • 2022-12-23
  • 2021-10-15
  • 2021-08-23
  • 2022-01-25
相关资源
相似解决方案