美文网首页
item2 自动连接ssh

item2 自动连接ssh

作者: 程序猿吴彦祖 | 来源:发表于2018-10-15 17:17 被阅读0次

    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

    相关文章

      网友评论

          本文标题:item2 自动连接ssh

          本文链接:https://www.haomeiwen.com/subject/rmtqzftx.html