Start a SSH session.
Requires hostname. you can also pass values for :username, :password and :port
keys. All other option key pairs will be passed as SSH config options.
(defn session
"Start a SSH session.
Requires hostname. you can also pass values for :username, :password and :port
keys. All other option key pairs will be passed as SSH config options."
[agent? & options]
(let [agent-provided? (ssh-agent? agent?)
agent (if agent-provided? agent? *ssh-agent*)
hostname (if agent-provided? (first options) agent?)
options (if agent-provided? (rest options) options)
options (apply hash-map options)]
(session-impl agent hostname
(or (options :username) (. System getProperty "user.name"))
(options :port)
(options :password)
(dissoc options :username :port :password))))
Comments top
No comments for session. Log in to add a comment.