如何:通过 Jumphost scp 到主机(两者都在非默认 22 端口上)?

如何:通过 Jumphost scp 到主机(两者都在非默认 22 端口上)?

我的Jumphost使用端口2222,我的最终主机使用端口20048,所以我使用

scp -P 2222 -J [email protected] [email protected]:20048/usr/local/var/log/frontend/test.log  .

我收到错误

kex_exchange_identification: read: Connection reset by peer
Connection reset by 192.168.1.16 port 22
kex_exchange_identification: Connection closed by remote host
Connection closed by UNKNOWN port 65535

错误“Connection Reset by 192.168.1.16 port 22”似乎表明第一个-P不起作用,所以我测试了该命令,看看会得到什么错误

scp -P 2222 -J [email protected] [email protected]/usr/local/var/log/frontend/test.log  .

我得到了错误。

cp: [email protected]/usr/local/var/log/frontend/test.log: No such file or directory

那么正确的命令是什么?

相关内容