搜索和研究但无法找到答案/解决方案
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)
感谢任何帮助
答案 0 :(得分:0)
该错误在特定版本之前的API中是已知的。如果可能,请尝试将net.schmizz.sshj依赖项升级到最新版本。