-
-
Save Licenser/74dff9294228f4300caa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def *config* (new java.util.Properties)) | |
(.put *config* "StrictHostKeyChecking" "no") | |
(def *jsch* (new com.jcraft.jsch.JSch)) | |
(def *session* (.getSession *jsch* "root" "192.168.197.45" 22)) | |
(doto *session* | |
(.setConfig *config*) | |
(.setPassword "-") | |
(.connect)) | |
(def *channel* (.openChannel *session* "exec")) | |
(doto *channel* | |
(.setCommand "ps -ef;date;hostname") | |
(.setInputStream nil) | |
(.setErrStream System/err)) | |
(def *ssh-in* (.getInputStream *channel*)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment