scp 免密expect脚本

2018-06-11  本文已影响0人  strean
#! /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"
上一篇 下一篇

猜你喜欢

热点阅读