進入~/.ssh檔案架中新建一個ssh專案 如ssh_tencent_cloud
vim ssh_tencent_cloud 進入編輯狀態新增以下配置
#!/usr/bin/expect -f
set user root
set host 0.0.0.0
set password ********
set timeout -1
spawn ssh $user@$host
expect "*assword:*"
send "$password\r"
interact
expect eof
在item2中新增