#!/usr/bin/expect
set src_path "./opencv.tar.gz"
set dst_path "/home/temp"
set passwd "123456"
spawn scp ${src_path} root@${ip}:${dst_path}
expect {
"password:"
{
send "$passwd\n"
使用expect 实现scp 自动输入密码
最新推荐文章于 2021-12-22 22:43:15 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)