item2记住账号密码

一.执行下面的代码将创建item2login.sh文件

sudo cat << EOF > item2login.sh
#!/usr/bin/expect

set timeout 30
spawn ssh -p [lindex $argv 0] [lindex $argv 1]@[lindex $argv 2]
expect {
    
    
        "(yes/no)?"
        {
    
    send "yes\n";exp_continue}
        "password:"
        {
    
    send "[lindex $argv 3]\n"}
}
interact
EOF

二.在item2>>Profiles>>Open Profiles…>>Edit Profiles>>General中设置要保存的账号密码。

Basics

  • name:填写名称

Command(按照下面的方式填写,每一项之间有空格):

  • Command(下拉框选择command):脚本地址 端口 用户名 IP地址 密码的方式填写

猜你喜欢

转载自blog.csdn.net/u012722296/article/details/108800382