Exhausted available authentication methods

794 views
Skip to first unread message

wensi liu

unread,
Dec 11, 2013, 7:08:58 PM12/11/13
to sshj-...@googlegroups.com
have simple code to connect aws but getting error

 Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
        final SSHClient ssh = new SSHClient();
//        ssh.addHostKeyVerifier("XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX");
        ssh.addHostKeyVerifier(new PromiscuousVerifier()) ;
        ssh.loadKnownHosts();
        ssh.connect(aws instance");
        PKCS8KeyFile keyFile = new PKCS8KeyFile();
        keyFile.init(new File("pem file"));
        ssh.authPublickey("ec2-user", keyFile );

Exception in thread "main" net.schmizz.sshj.userauth.UserAuthException: Exhausted available authentication methods
at net.schmizz.sshj.SSHClient.auth(SSHClient.java:217)
at net.schmizz.sshj.SSHClient.authPublickey(SSHClient.java:316)
at net.schmizz.sshj.SSHClient.authPublickey(SSHClient.java:335)


any idea?

appreciate for any help

Wensi
Reply all
Reply to author
Forward
0 new messages