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
Copy file name to clipboardExpand all lines: README.md
+305Lines changed: 305 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,3 +64,308 @@ tryssh -h
64
64
# View the help documentation for the subcommand "ssh"
65
65
tryssh ssh -h
66
66
```
67
+
68
+
## Detailed Function Explanation
69
+
70
+
```
71
+
$ tryssh -h
72
+
command line ssh terminal tool.
73
+
74
+
Usage:
75
+
tryssh [command]
76
+
77
+
Available Commands:
78
+
alias Set, unset, and list aliases, aliases can be used to log in to servers
79
+
create Create alternate username, port number, password, and login cache information
80
+
delete Delete alternate username, port number, password, and login cache information
81
+
get Get alternate username, port number, password, and login cache information
82
+
help Help about any command
83
+
prune Check if all current caches are available and clear the ones that are not available
84
+
scp Upload/Download file to/from the server through SSH protocol
85
+
ssh Connect to the server through SSH protocol
86
+
version Print the client version information for the current context
87
+
88
+
Flags:
89
+
-h, --help help for tryssh
90
+
91
+
Use "tryssh [command] --help" for more information about a command.
92
+
```
93
+
94
+
### Command: create
95
+
96
+
The `"create"` command of `tryssh` is used to create various configurations for password guessing login, such as usernames, port numbers, and passwords. It can also directly create caches with known usernames, port numbers, and passwords.
97
+
98
+
#### Help information
99
+
100
+
```
101
+
$ tryssh create -h
102
+
Create alternate username, port number, password, and login cache information
103
+
104
+
Usage:
105
+
tryssh create [command]
106
+
107
+
Available Commands:
108
+
caches Create a alternate cache
109
+
passwords Create a alternate password
110
+
ports Create a alternate port
111
+
users Create a alternate username
112
+
113
+
Flags:
114
+
-h, --help help for create
115
+
116
+
Use "tryssh create [command] --help" for more information about a command.
117
+
```
118
+
119
+
#### Example
120
+
121
+
```
122
+
# Create an alternative user named testuser
123
+
tryssh create users testuser
124
+
125
+
# Create an alternative port: 22
126
+
tryssh create ports 22
127
+
128
+
# Create an alternative passwords: 123456
129
+
tryssh create passwords 123456
130
+
```
131
+
132
+
### Command: delete
133
+
134
+
The `"delete"` command of `tryssh` is used to delete various configurations for password guessing login, such as usernames, port numbers, and passwords. It can also directly delete caches.
135
+
136
+
#### Help information
137
+
138
+
```
139
+
$ tryssh delete -h
140
+
Delete alternate username, port number, password, and login cache information
141
+
142
+
Usage:
143
+
tryssh delete [command]
144
+
145
+
Available Commands:
146
+
caches Delete a alternate cache
147
+
passwords Delete a alternate password
148
+
ports Delete a alternate port
149
+
users Delete a alternate username
150
+
151
+
Flags:
152
+
-h, --help help for delete
153
+
154
+
Use "tryssh delete [command] --help" for more information about a command.
155
+
```
156
+
157
+
#### Example
158
+
159
+
```
160
+
# Delete an alternative user named testuser
161
+
tryssh delete users testuser
162
+
163
+
# Delete an alternative port: 22
164
+
tryssh delete ports 22
165
+
166
+
# Delete an alternative passwords: 123456
167
+
tryssh delete passwords 123456
168
+
169
+
# Delete the cache information about 192.168.1.1
170
+
tryssh delete caches 192.168.1.1
171
+
```
172
+
173
+
### Command: get
174
+
175
+
The `"get"` command of `tryssh` is used to view various configurations for password guessing login, such as usernames, port numbers, passwords, and login caches.
176
+
177
+
#### Help information
178
+
179
+
```
180
+
$ tryssh get -h
181
+
Get alternate username, port number, password, and login cache information
182
+
183
+
Usage:
184
+
tryssh get [command]
185
+
186
+
Available Commands:
187
+
caches Get alternate caches by ipAddress
188
+
passwords Get alternate passwords
189
+
ports Get alternate ports
190
+
users Get alternate usernames
191
+
192
+
Flags:
193
+
-h, --help help for get
194
+
195
+
Use "tryssh get [command] --help" for more information about a command.
196
+
```
197
+
198
+
#### Example
199
+
200
+
```
201
+
# View candidate users for password guessing
202
+
tryssh get users
203
+
204
+
# View candidate ports for password guessing
205
+
tryssh get ports
206
+
207
+
# View the currently existing login caches
208
+
tryssh get caches
209
+
```
210
+
211
+
### Command: prune
212
+
213
+
The `"prune"` command of `tryssh` is used to test whether the existing caches are still usable. If they are not, you can choose to delete the cache, or directly delete it without confirmation.
214
+
215
+
#### Help information
216
+
217
+
```
218
+
$ tryssh prune -h
219
+
Check if all current caches are available and clear the ones that are not available
220
+
221
+
Usage:
222
+
tryssh prune [flags]
223
+
224
+
Flags:
225
+
-a, --auto Automatically perform concurrent cache optimization without asking for confirmation to delete
226
+
-c, --concurrency int Number of multiple requests to perform at a time (default 8)
227
+
-h, --help help for prune
228
+
-t, --timeout duration SSH timeout when attempting to log in. It can be "1s" or "1m" or other duration (default 2s)
# Conduct non-interactive cache availability testing, while setting the concurrency to 10 (default is 8) and the connection timeout to 5 seconds (default is 2 seconds).
241
+
tryssh prune -c 10 -t 5s -a
242
+
```
243
+
244
+
> The setting for concurrency is invalid in interactive mode.
245
+
246
+
### Command: alias
247
+
248
+
The `"alias"` command of `tryssh` is used to assign aliases to existing caches, making it convenient to use these aliases directly for login or file transfer operations.
249
+
250
+
#### Help information
251
+
252
+
```
253
+
$ tryssh alias -h
254
+
Set, unset, and list aliases, aliases can be used to log in to servers
255
+
256
+
Usage:
257
+
tryssh alias [command]
258
+
259
+
Available Commands:
260
+
list List all alias
261
+
set Set an alias for the specified server address
262
+
unset Unset the alias
263
+
264
+
Flags:
265
+
-h, --help help for alias
266
+
267
+
Use "tryssh alias [command] --help" for more information about a command.
268
+
```
269
+
270
+
#### Example
271
+
272
+
```
273
+
# View all current aliases
274
+
tryssh alias list
275
+
276
+
# Set an alias named 'host1' for the server with the IP address 192.168.1.1
277
+
tryssh alias set host1 -t 192.168.1.1
278
+
279
+
# Remove the alias named 'host1'
280
+
tryssh alias unset host1
281
+
```
282
+
283
+
### Command: ssh
284
+
285
+
The `"ssh"` command of `tryssh` is used for password guessing login to a server. Upon successfully obtaining the correct login information, it will cache these details for direct login in future attempts, without the need to guess the password again.
286
+
287
+
#### Help information
288
+
289
+
```
290
+
chenjingyu@MacBook ~ % tryssh ssh -h
291
+
Connect to the server through SSH protocol
292
+
293
+
Usage:
294
+
tryssh ssh <ipAddress> [flags]
295
+
296
+
Flags:
297
+
-c, --concurrency int Number of multiple requests to perform at a time (default 8)
298
+
-h, --help help for ssh
299
+
-t, --timeout duration SSH timeout when attempting to log in. It can be "1s" or "1m" or other duration (default 1s)
300
+
-u, --user string Specify a username to attempt to login to the server,
301
+
if the specified username does not exist, try logging in using that username
302
+
```
303
+
304
+
#### Example
305
+
306
+
```
307
+
# Login to the server at 192.168.1.1. If there is no cache available, attempt to guess the password for login
308
+
tryssh ssh 192.168.1.1
309
+
310
+
# Login to the server with the alias 'host1'
311
+
tryssh ssh host1
312
+
313
+
# Login to the server at 192.168.1.1. If there is no cache available, attempt to guess the password for login. Set the concurrency to 20, timeout to 500 milliseconds, and specify the user as 'root'.
314
+
tryssh ssh 192.168.1.1 -c 20 -t 500ms -u root
315
+
```
316
+
317
+
### Command: scp
318
+
319
+
The `"scp"` command of `tryssh` is used to upload or download files or directories. The scp command supports the use of aliases.
320
+
321
+
#### Help information
322
+
323
+
```
324
+
chenjingyu@MacBook ~ % tryssh scp -h
325
+
Upload/Download file to/from the server through SSH protocol
326
+
327
+
Usage:
328
+
tryssh scp <source> <destination> [flags]
329
+
330
+
Examples:
331
+
# Download test.txt file from 192.168.1.1 and place it under ./
332
+
tryssh scp 192.168.1.1:/root/test.txt ./
333
+
# Upload test.txt file to 192.168.1.1 and place it under /root/
334
+
tryssh scp ./test.txt 192.168.1.1:/root/
335
+
# Download test.txt file from 192.168.1.1 and rename it to test2.txt and place it under ./
336
+
tryssh scp 192.168.1.1:/root/test.txt ./test2.txt
337
+
338
+
# Download testDir directory from 192.168.1.1 and place it under ~/Downloads/
0 commit comments