The first one:
Java FTP uses Apache common-net, but FTP servers provided on the FTP service side only support SFTP, resulting
Java.net.ConnectException:Connection refused
The above error is on the company test server, the local running code error is as follows:
org.apache.commons.net.MalformedServerReplyException:Could not parse response code. Server reply:ssh-2.0-openssh_5.3
In summary: The use of Com.jcraft.jsch for SFTP is handled
The second one:
SFTP with Com.jcraft.jsch treatment found local test can, put in the company test environment error:
Java.net.ConnectException:Connection refused
Discovery: An exception occurred due to company security considerations that limited the company server SFTP permissions.
Operation of SFTP on Linux:
1:sftp-oport=22022 [email protected]
If the connection is denied, it is possible that SFTP is not supported locally on the SFTP server
Practical issues related to Java FTP sftp