wood burning stoves 2.0*
The moose likes Java in General and the fly likes SFTP PROBLEM!!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "SFTP PROBLEM!!!" Watch "SFTP PROBLEM!!!" New topic
Author

SFTP PROBLEM!!!

Gökhan Sakalli
Greenhorn

Joined: Apr 04, 2009
Posts: 20
String host = host_adress
SshClient ssh = new SshClient();
ssh.connect(host,port);
System.out.println("ssh is connected--->"+ssh.isConnected());
PasswordAuthenticationClient passwordAuthenticationClient = new PasswordAuthenticationClient();
passwordAuthenticationClient.setPassword(password);
passwordAuthenticationClient.setUsername(username);
int result = ssh.authenticate(passwordAuthenticationClient);
if(result != AuthenticationProtocolState.COMPLETE){
throw new Exception("Login to host failed");
}
ssh.disconnect();

Above i just want to connect to an FTP server. We gave them our IP adress and they gave us which port to connect and also we gave them the information that we would connect to their FTP server by using Core FTP.
They opened their port.

When i try to connect; i get this exception


java.net.ConnectException: Connection refused: connect

I use com.sshtools.j2ssh

What is wrong here? FTP over SSH? Yes i am using this. I also want to add that on the browser i get certificate error.

I'm gonna loose my mind...
Martin Vanyavchich
Ranch Hand

Joined: Sep 16, 2008
Posts: 241
Can you connect using FileZilla or CuteFTP to that ftp server?


SCJP 6, OCMJD 6, OCPJWSD 6
I no good English.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: SFTP PROBLEM!!!