scala-ssh icon indicating copy to clipboard operation
scala-ssh copied to clipboard

None of the configured keyfiles exists: ~/.ssh/id_rsa, ~/.ssh/id_dsa

Open tekumara opened this issue 9 years ago • 2 comments

Default key locations specified in SshLogin.scala are ~/.ssh/id_rsa, ~/.ssh/id_dsa but the tilde is a shell specific expansion and not applied, resulting in the following exception when using the default key locations:

java.lang.RuntimeException: None of the configured keyfiles exists: ~/.ssh/id_rsa, ~/.ssh/id_dsa 

Replacing the tilde with System.getProperty("user.home") would be better.

tekumara avatar Sep 02 '15 00:09 tekumara

The tilde is already expanded, see here: https://github.com/sirthias/scala-ssh/blob/master/src/main/scala/com/decodified/scalassh/HostConfig.scala#L121

sirthias avatar Sep 02 '15 08:09 sirthias

If anyone is having this error, for me it was because these files under macOS were encrypted. I had to use the AgentLogin instead (which depends on jsch.agentproxy.sshj and jsch.agentproxy.connector-factory). Then it worked well.

LPTK avatar Mar 27 '18 21:03 LPTK