我正在尝试自动执行scp命令的密码检查,我正在使用Expect命令,但是我并没有直接向服务器发送访问权限,而是试图从中复制文件,所以密钥是不可行的。
ive尝试了此帖子的答案 Using expect to pass a password to ssh
#!/usr/bin/expect
spawn sftp -b cmdFile user@xxx.xxx.xxx.xxx
expect "password:"
send -- "root"
interact
我遇到以下错误
line 2: spawn: command not found
couldnt read file "password":no such file or directory
line 4: send: command not found
line 5: interact: command not found