2

searched and researched but could not find answer/solution

Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
SSHClient ssh = new SSHClient();
ssh.addHostKeyVerifier(new PromiscuousVerifier());
ssh.connect("aws instance",22);
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)  

appreciate for any help

user2612196
  • 109
  • 1
  • 2
  • 4
  • 1
    Any chance you've found an answer somewhere else which you'd like to share? Because I have a similar problem... – Arnaud Mar 01 '14 at 23:59

1 Answers1

0

The error is known with the API before particular version. Try to upgrade net.schmizz.sshj dependency with the latest version if possible.

metzelder
  • 655
  • 2
  • 15
  • 35