You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by GitBox <gi...@apache.org> on 2022/12/21 14:14:54 UTC

[GitHub] [mina-sshd] ascertsimonm opened a new issue, #297: SSHD Client failing on private key file with key password

ascertsimonm opened a new issue, #297:
URL: https://github.com/apache/mina-sshd/issues/297

   ### Version
   
   2.9.2
   
   ### Bug description
   
   When attempting to run the SSH client with that private key file that is protected with a password the Mina SSH client doesn't make the connection.
   
   The client was run using the command
   
   `java -jar MinaSshClient-2.9.2.jar -i K:\id_rsa myuser@192.168.247.129`
   
   
   
   ### Actual behavior
   
   The client seems to fail to load the key resource with the following warning
   
   `WARNING: org.apache.sshd.cli.client.SshCl: Failed (FailedLoginException) to load key resource=K:\id_rsa: No password provider for encrypted key in K:\id_rsa`
   
   the connection subsequently fails with a "No more authentication methods available"
   
   
   ### Expected behavior
   
   The client should prompt for a password for the key file or have another command line parameter to specify it.
   
   ### Relevant log output
   
   _No response_
   
   ### Other information
   
   I did a bit of debugging on this and for whatever reason the prompt for the password for the private key file isn't being triggered by the code in the _SshClientCliSupport_,  _setupSessionIdentities_ method.  
   
   Whether or not it's the correct solution what  I did in my own code is I used the setPasswordFinder method on the FileKeyPairProvider with the same code segment as for the client `setFilePasswordProvider` and it seemed to work.
   


-- 
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-unsubscribe@mina.apache.org.apache.org

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


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


[GitHub] [mina-sshd] ascertsimonm commented on issue #297: SSHD Client failing on private key file with key password

Posted by GitBox <gi...@apache.org>.
ascertsimonm commented on issue #297:
URL: https://github.com/apache/mina-sshd/issues/297#issuecomment-1362725809

   Heya
   
   Yes, something like that but having things done automatically is better. Thanks
   
   Simon


-- 
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-unsubscribe@mina.apache.org

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


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


[GitHub] [mina-sshd] tomaswolf closed issue #297: SSHD Client failing on private key file with key password

Posted by GitBox <gi...@apache.org>.
tomaswolf closed issue #297: SSHD Client failing on private key file with key password
URL: https://github.com/apache/mina-sshd/issues/297


-- 
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-unsubscribe@mina.apache.org

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


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


[GitHub] [mina-sshd] tomaswolf commented on issue #297: SSHD Client failing on private key file with key password

Posted by GitBox <gi...@apache.org>.
tomaswolf commented on issue #297:
URL: https://github.com/apache/mina-sshd/issues/297#issuecomment-1361969405

   If you mean that you added in [SshClientCliSupport, line 508](https://github.com/apache/mina-sshd/blob/78ed6bc9/sshd-cli/src/main/java/org/apache/sshd/cli/client/SshClientCliSupport.java#L508) something like
   ```
   provider.setPasswordFinder(client.getFilePasswordProvider());
   ```
   I agree that this is one way of solving this.
   
   However, I wonder if this was not better done automatically in [SshClient](https://github.com/apache/mina-sshd/blob/78ed6bc9/sshd-core/src/main/java/org/apache/sshd/client/SshClient.java#L755) by making sure the session's effective keypair provider does have a password finder set.


-- 
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-unsubscribe@mina.apache.org

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


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