You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
stdoutChan, stderrChan, doneChan, errChan, err = ssh.Stream("for i in {1..5}; do echo ${i}; sleep 1; done; exit 2;", 60*time.Second)
53
+
```
54
+
55
+
MakeConfig takes in the following properties:
56
+
57
+
| property | description |
58
+
| -------------- | --------------- |
59
+
| user | The SSH user to be logged in with |
60
+
| Server | The IP or hostname pointing of the server |
61
+
| Key | A string containing the private key to be used when making the connection |
62
+
| KeyPath | The path pointing to the SSH key file to be used when making the connection |
63
+
| Port | The port to use when connecting to the SSH daemon of the server |
64
+
| Protocol | The tcp protocol to be used: `"tcp", "tcp4" "tcp6"`|
65
+
| Passphrase | The Passphrase to unlock the provided SSH key (leave blank if no Passphrase is required) |
66
+
| Password | The Password to use to login the specified user |
67
+
| Timeout | The length of time to wait before timing out the request |
68
+
| Proxy | An additional set of configuration params that will be used to SSH into an additional server via the server configured in this top-level block |
69
+
| Ciphers | An array of ciphers (e.g. aes256-ctr) to enable for the SSH connection |
70
+
| KeyExchanges | An array of key exchanges (e.g. ecdh-sha2-nistp384) to enable for the SSH connection |
71
+
| Fingerprint | The expected fingerprint to be returned by the SSH server, results in a fingerprint error if they do not match |
72
+
| UseInsecureCipher | Enables the use of insecure ciphers and key exchanges that are insecure and can lead to compromise, [see ssh](#ssh)|
73
+
74
+
NOTE: Please view the reference documentation for the most up to date properties of [MakeConfig](https://pkg.go.dev/github.com/appleboy/easyssh-proxy#MakeConfig) and [DefaultConfig](https://pkg.go.dev/github.com/appleboy/easyssh-proxy#DefaultConfig)
36
75
37
76
### ssh
38
77
39
-
See [example/ssh/ssh.go](./example/ssh/ssh.go)
78
+
See [examples/ssh/ssh.go](./_examples/ssh/ssh.go)
40
79
41
80
```go
42
81
package main
@@ -97,7 +136,7 @@ func main() {
97
136
98
137
### scp
99
138
100
-
See [example/scp/scp.go](./example/scp/scp.go)
139
+
See [examples/scp/scp.go](./_examples/scp/scp.go)
101
140
102
141
```go
103
142
package main
@@ -132,26 +171,32 @@ func main() {
132
171
133
172
### SSH ProxyCommand
134
173
135
-
See [example/proxy/proxy.go](./example/proxy/proxy.go)
174
+
See [examples/proxy/proxy.go](./_examples/proxy/proxy.go)
136
175
137
176
```go
138
177
ssh:= &easyssh.MakeConfig{
139
178
User: "drone-scp",
140
179
Server: "localhost",
141
180
Port: "22",
142
181
KeyPath: "./tests/.ssh/id_rsa",
182
+
Timeout: 60 * time.Second,
143
183
Proxy: easyssh.DefaultConfig{
144
184
User: "drone-scp",
145
185
Server: "localhost",
146
186
Port: "22",
147
187
KeyPath: "./tests/.ssh/id_rsa",
188
+
Timeout: 60 * time.Second,
148
189
},
149
190
}
150
191
```
151
192
193
+
NOTE: Properties for the Proxy connection are not inherited from the Jumphost. You must explicitly specify them in the DefaultConfig struct.
194
+
195
+
e.g. A custom `Timeout` length must be specified for both the Jumphost (intermediary server) and the destination server.
196
+
152
197
### SSH Stream Log
153
198
154
-
See [example/stream/stream.go](./example/stream/stream.go)
199
+
See [examples/stream/stream.go](./_examples/stream/stream.go)
0 commit comments