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

connect to host requiring ssh-rsa #155

Open
lilactown opened this issue May 18, 2024 · 0 comments
Open

connect to host requiring ssh-rsa #155

lilactown opened this issue May 18, 2024 · 0 comments

Comments

@lilactown
Copy link

I am trying to connect to a host. When I try to connect, I receive the error com.jcraft.jsch.JSchException: Session.connect: java.io.IOException: End of IO Stream Read.

$ cat script
(ssh {:hostname "10.11.99.1"
      :username "root"
      :identity "~/.ssh/id_rsa_remarkable"
      :passphrase ""}
  (get-fact))
$ spire script
Exception in thread "main" com.jcraft.jsch.JSchException: Session.connect: java.io.IOException: End of IO Stream Read
	at com.jcraft.jsch.Session.connect(Session.java:570)
	at com.jcraft.jsch.Session.connect(Session.java:185)
	at spire.transport$connect.invokeStatic(transport.clj:34)
	at spire.transport$open_connection$fn__12677.invoke(transport.clj:56)
	at clojure.core$update.invokeStatic(core.clj:6185)
	at clojure.core$update.invoke(core.clj:6177)
	at clojure.lang.Atom.swap(Atom.java:65)
	at clojure.core$swap_BANG_.invokeStatic(core.clj:2358)
	at spire.transport$open_connection.invokeStatic(transport.clj:51)
	at spire.transport$open_connection.invoke(transport.clj:50)
	at sci.impl.vars.SciVar.invoke(vars.cljc:325)
	at sci.impl.analyzer$return_call$reify__4565.eval(analyzer.cljc:1149)
	at sci.impl.evaluator$eval_let$fn__2076.invoke(evaluator.cljc:65)
	at sci.impl.evaluator$eval_let.invokeStatic(evaluator.cljc:56)
	at sci.impl.analyzer$analyze_let_STAR_$reify__4237.eval(analyzer.cljc:492)
	at sci.impl.evaluator$eval_try.invokeStatic(evaluator.cljc:125)
	at sci.impl.analyzer$analyze_try$reify__4320.eval(analyzer.cljc:741)
	at sci.impl.evaluator$eval_let.invokeStatic(evaluator.cljc:74)
	at sci.impl.analyzer$analyze_let_STAR_$reify__4237.eval(analyzer.cljc:492)
	at sci.impl.interpreter$eval_form.invokeStatic(interpreter.cljc:39)
	at sci.impl.interpreter$eval_string_STAR_.invokeStatic(interpreter.cljc:61)
	at sci.core$eval_string_STAR_.invokeStatic(core.cljc:235)
	at spire.eval$evaluate.invokeStatic(eval.clj:87)
	at spire.core$_main.invokeStatic(core.clj:85)
	at spire.core$_main.doInvoke(core.clj:59)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at spire.core.main(Unknown Source)
Caused by: java.io.IOException: End of IO Stream Read
	at com.jcraft.jsch.IO.getByte(IO.java:85)
	at com.jcraft.jsch.Session.read(Session.java:1175)
	at com.jcraft.jsch.Session.connect(Session.java:328)
	... 26 more

I did a bit of research and I see that this project uses a fork of jsch which followed OpenSSH's move to deprecate ssh-rsa. My hunch is that this could be related to the connection issues.

However, trying to follow their guidance does not lead to any different behavior:

$ cat script
(ssh {:hostname "10.11.99.1"
      :username "root"
      :identity "~/.ssh/id_rsa_remarkable"
      :passphrase ""
      :jsch-options {:server-host-key-fn (fn [s] (str s ",ssh-rsa"))}}
  (get-fact))
$ spire script
Exception in thread "main" com.jcraft.jsch.JSchException: Session.connect: java.io.IOException: End of IO Stream Read
	at com.jcraft.jsch.Session.connect(Session.java:570)
...

Any advice/guidance is appreciated

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

1 participant