We are getting following error when we tried to connect one of our SFTP host.
The connection did not complete
com.enterprisedt.net.ftp.ssh.SSHFTPException: The SSH client has not yet connected to the server. The requested action cannot be performed until after a con
nection has been established.
at com.enterprisedt.net.ftp.ssh.SCPClient.checkConnection(Unknown Source)
at com.enterprisedt.net.ftp.ssh.SSHFTPClient.quit(Unknown Source)
at com.db.ftptest.FTPTest.performFtp(FTPTest.java:83)
Please see edtFtpj java code for the SFTP connectivity
SSHFTPClient ftp = new SSHFTPClient();
ftp.setConfigFlags(SSHFTPClient.ConfigFlags.DISABLE_CHMOD_AFTER_PUT);
ftp.setRemoteHost(SFTP_HOST);
ftp.setRemotePort(sftp_port);
ftp.getProxySettings().setProxyAddress("socks-proxy-servert.com");
ftp.getProxySettings().setProxyPort(1080);
ftp.getProxySettings().setProxyType(ProxyType.SOCKS4);
ftp.connect();
We are able to connect successfully for the same SFTP host using following command
Via unix command line
sftp -v -o "Proxycommand=/usr/lib/ssh/ssh-socks5-proxy-connect -h socks-proxy-servert.com -p 1080 SFTP_HOST sftp_port" user@SFTP_HOST
We would highly appreciate your help in this regard.