#!/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 自动输入密码
最新推荐文章于 2024-04-27 00:32:10 发布
![](https://img-home.csdnimg.cn/images/20240611030827.png)