clj-commons / clj-commons/clj-ssh

non system agent not working?

Open
#26 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Clojure
Stars
241
Forks
66
PR merge metrics
No merged PRs in 30d

Description

Not sure if this is a bug or just something missing from the documentation, but when I do

```
(Let [agent (ssh-agent {})]
(let [session (session agent domain {:strict-host-key-checking :no})]
(with-connection session
(let [result (ssh session {:cmd "ls"})]
(println result)))))
```

things work fine, whereas when I do

```
(let [agent (ssh-agent {:use-system-ssh-agent false
:known-hosts-path "/Users/joachim/.ssh/known_hosts"})]
(add-identity agent {:private-key-path "/Users/joachim/.ssh/id_rsa"
:public-key-path "/Users/joachim/.ssh/id_rsa.pub"})
(let [session (session agent domain {:username "joachim" :strict-host-key-checking :no})]
(with-connection session
(let [result (ssh session {:cmd "ls"})]
(println result)))))
```

I get

```
JSchException USERAUTH fail com.jcraft.jsch.UserAuthPublicKey.start (UserAuthPublicKey.java:119)
```

(The private and public key paths provided are the same as used by the system ssh-agent)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the two ssh-agent examples in the issue and compare the system-agent path with the explicit key setup. Inspect the authentication failure reported as JSchException USERAUTH fail; done means identifying whether non-system authentication is broken or documenting the required configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.