Exhausted available authentication method

4.9k views Asked by At

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

1

There are 1 answers

0
metzelder On

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