#!/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 自动输入密码
最新推荐文章于 2025-05-04 14:28:46 发布