Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use'ing clj-ssh.cli fails if known_hosts file does not exist #27

Open
tatut opened this issue Jun 24, 2014 · 2 comments
Open

Use'ing clj-ssh.cli fails if known_hosts file does not exist #27

tatut opened this issue Jun 24, 2014 · 2 comments

Comments

@tatut
Copy link

tatut commented Jun 24, 2014

user=> (use 'clj-ssh.cli)

CompilerException com.jcraft.jsch.JSchException: java.io.FileNotFoundException: C:\Users\Tatu.ssh\known_hosts (The system cannot find the file specified), compiling:(cli.clj:39:15)

Creating an empty known_hosts fixes the issue.

@sirwobin
Copy link

Amazing that this issue is 2 years old. I'm running a process in AWS lambda where I don't have control over known_hosts. Is any fix planned?

@mdaley
Copy link

mdaley commented Apr 21, 2017

clj-ssh is currently using com.jcraft.jsch version 0.1.53. If you look in the code for the latest version of com.jcraft.jsch (0.1.54), you'll see that, in KnownHosts.java, the setKnownHosts method has been changed to have an empty catch for FileNotFoundException. In 0.1.53 there was throw new JschException.... So, now, it doesn't matter if the known_hosts file isn't present initially.

So the answer for me was to exclude com.jcraft/jsch from clj-ssh and specifically include the latest version 0.1.54.

dboitnot added a commit to sigdba/git-mirror that referenced this issue Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants