1
xuxueyang
2024-07-08 a72add8a584fc017da11b6f6e05a749ad7f2f4f7
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/expect
set user root
set ipaddress 106.14.123.210
set passwd M\@7626fdebe015ae2fde98
set timeout 30
set port 22
 
spawn ssh -p $port $user@$ipaddress
expect {
    "*password:" { send "$passwd\r" }
    "yes/no" { send "yes\r";exp_continue }
}
interact