Skip to content

Instantly share code, notes, and snippets.

@Licenser
Created November 13, 2009 12:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Licenser/0362c56884446dfeb1a8 to your computer and use it in GitHub Desktop.
Save Licenser/0362c56884446dfeb1a8 to your computer and use it in GitHub Desktop.
(defmacro with-session
[user password host port & code]
`(let
[config (new java.util.Properties)
session (.getSession *jsch* ~user ~host ~port)]
(.put config "StrictHostKeyChecking" "no")
(doto session
(.setConfig config)
(.setPassword ~password)
(.connect))
~code))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment