首页
IT
登录
6mi
u
盘
搜
搜 索
IT
scp自动输入密码
scp自动输入密码
xiaoxiao
2021-11-29
21
#!/usr/bin/expect -f
set src_path [lindex $argv 0]
//读取从bash传过来的参数
set password ********
spawn scp -P 22 -o GSSAPIAuthentication=no -r /home/dataProcess/HB_NRTM_hour_AH_2016111709_P01_END.CSV root@10.225.124.206:/root/jiakuanData
set timeout 300
expect "root@10.225.124.206's password:"
set timeout 300
send "$password\r"
set timeout 300
send "exit\r"
expect eof
转载请注明原文地址: https://ju.6miu.com/read-678618.html
专利
最新回复
(
0
)