美文网首页
scp 免密expect脚本

scp 免密expect脚本

作者: strean | 来源:发表于2018-06-11 15:50 被阅读0次
    #! /bin/sh
    expect -c "
        spawn scp -r asd.sh user@ip:/Users/
        expect {
            \"*assword\" {set timeout 300; send \"passwd\r\"; exp_continue;}
            \"yes/no\" {send \"yes\r\";}
        }
    expect eof"
    

    相关文章

      网友评论

          本文标题:scp 免密expect脚本

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