 
 (defn ssh-opts 
   "SSH session options" 
-  ([port]
-   {:username "root" :strict-host-key-checking :no :port port})
   ([port user]
    {:username user :strict-host-key-checking :no :port port}))
 
 (defn with-session 
   "Executes f on host with an ssh session"
-  [host port user f]
+  [{:keys [host port user] :or {user "root" port 22}} f]
   (let [agent (ssh-agent  {:use-system-ssh-agent false})]
     (add-identity agent (config :ssh)) 
     (let [session (session agent host (ssh-opts port user))] 

  (doseq [line (line-seq (clojure.java.io/reader out))] (debug line))
  ) 

(defn execute [{:keys [host port user] :or {port 22}} & batches]
  {:pre [(every? sequential? batches)]}
  "Executes remotly using ssh for example: (execute {:host \"192.168.20.171\"} [\"ls\"])"
  (doseq [b batches]
    (with-session host port user
      (fn [session]
        (let [{:keys [channel out-stream] :as res} (ssh session {:in  (join "\n" b)  :out :stream :agent-forwarding false})]
          (log-output out-stream)

(defn put 
  "Copies a file into host under dest"
  [host file dest]
  (with-session {:host host :port 22} 
    (fn [session]
      (let [channel (ssh-sftp session)]
        (with-channel-connection channel
