scala-ssh
scala-ssh copied to clipboard
None of the configured keyfiles exists: ~/.ssh/id_rsa, ~/.ssh/id_dsa
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.
The tilde is already expanded, see here: https://github.com/sirthias/scala-ssh/blob/master/src/main/scala/com/decodified/scalassh/HostConfig.scala#L121
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.