Primitive keychain support for clj-ssh. Only implemented on OSX at the moment.
Primitive keychain support for clj-ssh. Only implemented on OSX at the moment.
SSH in clojure. Uses jsch. Provides a ssh function that tries to look similar to clojure.contrib.shell/sh.
The top level namespace is clj-ssh.ssh
(use 'clj-ssh.ssh)
There is a simple ssh
function, which by default, will try and use a id_rsa
key in your $HOME/.ssh directory.
(ssh hostname cmd)
Strict host key checking can be turned off.
(default-session-options {:strict-host-key-checking :no})
More advance usage is possible.
(with-ssh-agent []
(add-identity path-to-private-key)
(let [session (session hostname :strict-host-key-checking :no)]
(with-connection session
(let [result (ssh session :in commands-string :result-map true)]
(println (result :out)))
(let [result (ssh session some-cmd-string)]
(println (second result))))))
Via maven and the clojars (http://clojars.org/clj-ssh), or Leiningen (http://github.com/technomancy/leiningen).
Licensed under EPL (http://www.eclipse.org/legal/epl-v10.html)
SSH in clojure. Uses jsch. Provides a ssh function that tries to look similar to clojure.contrib.shell/sh. ## Usage The top level namespace is `clj-ssh.ssh` (use 'clj-ssh.ssh) There is a simple `ssh` function, which by default, will try and use a id_rsa key in your $HOME/.ssh directory. (ssh hostname cmd) Strict host key checking can be turned off. (default-session-options {:strict-host-key-checking :no}) More advance usage is possible. (with-ssh-agent [] (add-identity path-to-private-key) (let [session (session hostname :strict-host-key-checking :no)] (with-connection session (let [result (ssh session :in commands-string :result-map true)] (println (result :out))) (let [result (ssh session some-cmd-string)] (println (second result)))))) ## Installation Via maven and the clojars (http://clojars.org/clj-ssh), or Leiningen (http://github.com/technomancy/leiningen). ## License Licensed under EPL (http://www.eclipse.org/legal/epl-v10.html)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close