如何让我的期望脚本检查服务器是否正在使用 ECDSA 密钥,以及它是否继续使用该脚本,否则如果它类似于 RSA 立即退出?
#!/usr/bin/expect
#Usage sshsudologin.expect <host> <ssh user> <ssh password>
set timeout 60
spawn ssh [lindex $argv 1]@[lindex $argv 0]
expect "yes/no" {
send "yes\r"
expect "*?assword" { send "[lindex $argv 2]\r" }
} "*?assword" { send "[lindex $argv 2]\r" }
expect " " { send "sudo su -\r" }
expect " " { send "commands\r" }
expect " " { send "exit\r" }
expect " " { send "exit\r" }
interact