cd ~/.ssh
vi item2.sh
#!/usr/bin/expect -f
set user root
set host 192.168.94.134
set password javen.zhou
set port 12345
set timeout -1
spawn ssh -p $port $user@$host
expect "*assword:*"
send "$password\r"
interact
expect eof
item2 -> Profiles -> 左边创建然后点右边的-> Command(默认 login shell) -> 填写 expect ~/.ssh/item2.sh