shell script 通过文本直接执行ssh命令

    xiaoxiao2021-03-25  89

    #!/usr/bin/expect set user [ lindex $argv 0 ]    #用户名 set ip [ lindex $argv 1 ]      #访问ip set passwd [ lindex $argv 2 ]      #用户密码 spawn ssh $user@$ip expect {         "password:"     { send "$passwd\r"; exp_continue } } interact ~                   
    转载请注明原文地址: https://ju.6miu.com/read-17018.html

    最新回复(0)