当我只运行这些命令时,我遇到了一个问题.
远程服务器想要传递yes以在RSA文件中添加密钥,因为第一次建立连接scp.
命令如下
#!/bin/bash
scp -P58222 root@IP:/root/K /N
/usr/bin/expect -c 'expect "\n" { expect "Are you sure you want to continue connecting (yes/no)?" }'
send "yes\r"
expect "$ "
send "exit\r"
Run Code Online (Sandbox Code Playgroud)
实际上我在询问时必须在我的脚本中传递yes
无法建立主机'IP地址(IP地址)'的真实性.
RSA key fingerprint is xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx.
Are you sure you want to continue connecting (yes/no)?
Run Code Online (Sandbox Code Playgroud)
您确定要继续连接(是/否)吗?
我怎么能摆脱这个问题?
同
scp -o StrictHostKeyChecking=no
Run Code Online (Sandbox Code Playgroud)
它还在问.