Re: [I] SSHD Client failing on private key file with key password [mina-sshd]

2024-05-05 Thread via GitHub


tomaswolf commented on issue #297:
URL: https://github.com/apache/mina-sshd/issues/297#issuecomment-2094892046

   @abhishekpandey96 : you need to set a `FilePasswordProvider` on the client 
or directly on the `FileKeyPairProvider`. Your code just sets a password 
identity, which means "use password authentication with the given passphrase".


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



Re: [I] SSHD Client failing on private key file with key password [mina-sshd]

2024-05-05 Thread via GitHub


abhishekpandey96 commented on issue #297:
URL: https://github.com/apache/mina-sshd/issues/297#issuecomment-2094684335

   Hi I am trying to add a passphrase with a dsa private key path  but I am 
getting org.apache.sshd.common.SshException: No more authentication methods 
available
   at 
org.apache.sshd.common.future.AbstractSshFuture.verifyResult(AbstractSshFuture.java:141)
   at 
org.apache.sshd.client.future.DefaultAuthFuture.verify(DefaultAuthFuture.java:56)
   at 
org.apache.sshd.client.future.DefaultAuthFuture.verify(DefaultAuthFuture.java:35)
   at 
org.apache.sshd.common.future.VerifiableFuture.verify(VerifiableFuture.java:45)
   
   
   snipped code is :-
   KeyIdentityProvider keyIdentityProvider = new KeyIdentityProvider() {
   private final FileKeyPairProvider keyPairProvider = new 
FileKeyPairProvider(Paths.get(privateKeyPath));
   
   @Override
   public Iterable loadKeys(SessionContext 
sessionContext) throws IOException {
   return keyPairProvider.loadKeys(sessionContext);
   }
   };
   
   client.setKeyIdentityProvider(keyIdentityProvider);
   
   try (ClientSession appSession = client.connect(appUserName, 
appHostName, appPort).verify(1).getSession()) {
   appSession.addPasswordIdentity(passphrase);
   appSession.auth().verify();
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org