hallo an die profis,
1. frage ... ich kann keine verbindung in einer java-application herstellen. -- > Exception "com.jcraft.jsch.JSchException: Algorithm negotiation fail".
2. mit fileZilla client funktioniert der zugriff bestens.
3. implementiert ist jsch-0.1.55.jar als bibliothek.
wo ist mein denkfehler ?
danke für eure antwort und bemühung
gruß mika
1. frage ... ich kann keine verbindung in einer java-application herstellen. -- > Exception "com.jcraft.jsch.JSchException: Algorithm negotiation fail".
2. mit fileZilla client funktioniert der zugriff bestens.
3. implementiert ist jsch-0.1.55.jar als bibliothek.
wo ist mein denkfehler ?
danke für eure antwort und bemühung
gruß mika
Java:
import com.jcraft.jsch.*;
public class SftpExample {
public static void main(String[] args) {
String host = "xxxxxxxxx.ssh.w1.strato.hosting";
String user = "stu123456789";
String password = "passwort";
int port = 22;
try {
JSch jsch = new JSch();
Session session = jsch.getSession(user, host, port);
session.setPassword(password);
session.setConfig("StrictHostKeyChecking", "no");
session.connect();
/**
Perform SFTP operations here
*/
session.disconnect();
} catch (Exception e) {
e.printStackTrace();
}
}
}