Can anyone give me an example of private/public key authentication in sshj?
In sshj what's the command line equivalent of,
ssh -i /path/to/mykey.private username@host
I tried (error handling omitted),
final SSHClient ssh = new SSHClient();
ssh.loadKnownHosts();
ssh.connect("host");
ssh.authPublickey("username", "/path/to/mykey.private");
final Session session = ssh.startSession();
...
but in the log statements I see,
DEBUG net.schmizz.sshj.SSHClient - Attempting to load key from: /path/to/mykey.private
WARN net.schmizz.sshj.SSHClient - Could not load keys due to: {}
net.schmizz.sshj.common.SSHException: No provider available forUnknown key file
at net.schmizz.sshj.SSHClient.loadKeys(SSHClient.java:482) ~[sshj-0.3.0.jar:na]
...
Exception in thread "main" 10:49:55.943 [reader] DEBUG
net.schmizz.sshj.transport.Reader - Stopping
net.schmizz.sshj.userauth.UserAuthException: Exhausted available authentication methods
Thanks, Everett