@@ -8,27 +8,37 @@ SSH in clojure. Uses jsch.
8
8
9
9
The ` clj-ssh.cli ` namespace provides some functions for ease of use at the REPL.
10
10
11
- (use 'clj-ssh.ssh)
11
+ ``` clj
12
+ (use 'clj-ssh.cli)
13
+ ```
12
14
13
- Use ` ssh ` to execute a command, say ` ls ` , on a remote host \ " my-host\ " ,
15
+ Use ` ssh ` to execute a command, say ` ls ` , on a remote host "my-host",
14
16
15
- (ssh \"my-host\" \"ls\")
16
- => {:exit 0 :out \"file1\\nfile2\\n\" :err \"\")
17
+ ``` clj
18
+ (ssh " my-host" " ls" )
19
+ => {:exit 0 :out " file1\n file2\n " :err " " )
20
+ ```
17
21
18
22
By default this will use the system ssh-agent to obtain your ssh keys, and it
19
23
uses your current username, but this can be specified:
20
24
21
- (ssh \"my-host\" \"ls\" :username \"remote-user\")
22
- => {:exit 0 :out \"file1\\nfile2\\n\" :err \"\")
25
+ ```clj
26
+ (ssh " my-host" " ls" :username " remote-user" )
27
+ => {:exit 0 :out " file1\n file2\n " :err " " )
28
+ ```
23
29
24
30
Strict host key checking can be turned off:
25
31
26
- (default-session-options {:strict-host-key-checking :no})
32
+ ```clj
33
+ (default-session-options {:strict-host-key-checking :no })
34
+ ```
27
35
28
36
SFTP is also supported. For example, to copy a local file to a remote host
29
- \ " my-host\ " :
37
+ " my-host" :
30
38
31
- (sftp \"my-host\" :put \"/from/this/path\" \"to/this/path\")
39
+ ```clj
40
+ (sftp " my-host" :put " /from/this/path" " to/this/path" )
41
+ ```
32
42
33
43
Note that any sftp commands that change the state of the sftp session (such as
34
44
cd) do not work with the simplified interface, as a new session is created each
0 commit comments