Namespaces

 
0.2.0-SNAPSHOT Arrow_down_16x16

create-ssh-agent

clj-ssh.ssh

  • (create-ssh-agent)
  • (create-ssh-agent add-default-identity?)
  • (create-ssh-agent private-key passphrase?)
Create an ssh-agent. By default try and add the current user's id_rsa key.

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source clj_ssh/ssh.clj:183 top

(defn create-ssh-agent
  "Create an ssh-agent. By default try and add the current user's id_rsa key."
  ([] (create-ssh-agent true))
  ([add-default-identity?]
     (if (or (string? add-default-identity?)
             (instance? java.io.File add-default-identity?))
       (create-ssh-agent add-default-identity? nil)
       (let [agent (JSch.)]
         (when add-default-identity?
           (if-let [default-id (default-identity)]
             (add-identity-with-keychain agent default-id)))
         agent)))
  ([private-key passphrase?]
     (let [agent (JSch.)]
       (if passphrase?
         (add-identity agent private-key passphrase?)
         (add-identity-with-keychain agent private-key))
       agent)))
Vars in clj-ssh.ssh/create-ssh-agent: agent defn if-let instance? let or string? when
Used in 0 other vars

Comments top

No comments for create-ssh-agent. Log in to add a comment.