agent-Specialization/project/ssh/ssh_connect.exp
2025-11-14 16:44:12 +08:00

20 lines
357 B
Plaintext
Executable File

#!/usr/bin/expect -f
set timeout 30
set hostname "59.110.19.30"
set username "root"
set password "@CuiYuJian040618"
spawn ssh $username@$hostname
expect {
"*password:" {
send "$password\r"
}
"*Are you sure you want to continue connecting*" {
send "yes\r"
expect "*password:"
send "$password\r"
}
}
interact