sftp服务器为了安全,更换了监听端口,sftp客户端连接服务器时报如下错误:
[root@iZ2zeezw67v09s8gw1zfotZ ~]# sftp abc@124.193.194.17 -p9022
ssh_exchange_identification: Connection closed by remote host
Couldn't read packet: Connection reset by peer
经过各种分析排查,发现部分linux发行版的sftp参数位置或参数大小写敏感导致
通过以下命令,顺利连接sftp服务器,问题解决。
[root@iZ2zeezw67v09s8gw1zfotZ ~]# sftp -P9022 abc@124.193.194.17