-
Notifications
You must be signed in to change notification settings - Fork 1
/
zssh2.1
301 lines (246 loc) · 5.97 KB
/
zssh2.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
.\" -*- nroff -*-
.\"
.\" zssh.1
.\"
.\" Author: Matthieu Lucotte <gounter@users.sourceforge.net>
.\"
.\" Copyright (c) 2000 Matthieu Lucotte <gounter@users.sourceforge.net> France
.\" All rights reserved
.\"
.\" Created: Mon Jun 26 23:18:13 2000
.TH ZSSH2 1 "June 26, 2000" "ZSSH2" "ZSSH2"
.SH NAME
zssh2 \- interactive file transfer wrapper for ssh
.SH SYNOPSIS
.B zssh2 [zssh options] [--] [ssh options]
.SH DESCRIPTION
.LP
.B zssh
(Zmodem SSH) is a program for interactively transferring files to a remote
machine while using the secure shell (
.B ssh
). It is intended to be a
convenient alternative to
.B scp
, allowing one to transfer files without having to
open another session and re-authenticate oneself.
zssh is an interactive wrapper for ssh used to switch the ssh connection
between the remote shell and file transfers. This is achieved by using
another tty/pty pair between the user and the local ssh process to plug
either the user's tty (remote shell mode) or another process (file transfer
mode) on the ssh connection.
Files are transferred through the
.I zmodem
protocol, using the
.B rz
and
.B sz
commands.
zssh behaves as an usual ssh session until the escape sequence is depressed
( default is
.B ^@
which can be produced by pressing C-space, or C-2, or C-` ), which enables
file transfer mode. A new prompt is then
displayed, and commands can be executed locally to initiate file transfers
(among other things). It roughly behaves as a local shell featuring line
edition, history and completion (thanks to libreadline), globbing, and
escape characters ( " ' and \\ ).
The following builtins are handled by zssh itself:
.B ?
,
.B cd
,
.B disconnect
,
.B escape
,
.B exit
,
.B help
,
.B hook
,
.B quit
,
.B repeat
,
.B rz
,
.B suspend
,
.B sz
,
.B version
.PP
.PD 0
.TP 20
.B cd <dir>
change current directory
.TP 20
.B disconnect
disconnect and exit
.TP 20
.B escape [^X]
Change escape key to ^X. Without argument, print current escape key
.TP 20
.B exit
exit file transfer mode. ^D may also be used for this purpose.
.TP 20
.B help
print help and tips
.TP
.B ?
.TP 20
.B hook prg [args]
Hook program 'prg' on the pty. Its standard input and output will go
through the ssh channel.
.br
typing 'sz'/'rz' is in fact equivalent to 'hook sz'/'hook rz'
.br
A weird imagination is most useful to gain full advantage of this feature.
.TP 20
.B quit
same as exit.
.TP 20
.B repeat
repeats cmd forever (^C to interrupt). Useful for example if you use a
remote script invoking "sz" and you don't want to be typing "rz" each
time...
Remember however that several files can be transferred by a single
sz/rz pair so this is not usually necessary to use repeat.
.TP 20
.B rz
Receive files from the remote machine. runs rz and plugs the process on the ssh connection.
running sz on the REMOTE machine is required :
.TP 25
.B \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 1)
run `sz <remote_file> ...' from the remote machine shell
.TP
.B \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 2)
press the escape sequence (C-space) to enter file transfer mode
.TP
.B \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 3)
run the `rz' builtin
.TP 20
.B suspend
suspend zssh (back to the local machine shell)
.TP 20
.B sz <file> ...
Send files to the remote machine. runs sz and plugs the process on the ssh connection.
There is no need to manually run rz on the remote side.
.TP 20
.B version
print version information
.PD
.PP
builtins
.B rz
,
.B sz
,
.B hook
and
.B exit
return to shell mode after completion.
.SH OPTIONS
.LP
.PP
.PD 0
.TP 20
.B -f
.TP
.B --force
Do not ask user any question
.TP
.B -h
.TP
.B --help
show basic help
.TP
.B -s cmd
.TP
.B --shell cmd
run cmd as remote shell instead of the default
"ssh -e none"
.br
ex: zssh -s "telnet -8 -E"
.TP
.B -V
.TP
.B --version
show version
.TP
.B -z ^X
.TP
.B --zssh-escape ^X
set escape sequence to ^X
.PD
.PP
.B --
may be used to separate zssh options from ssh ones
.br
Other arguments are passed verbatim to ssh/telnet/whatever.
.SH ENVIRONMENT
.LP
.PP
.PD 0
.TP 10
.B ZSSHESCAPE
Setting the ZSSHESCAPE environment variable allows one to override the default
escape sequence. ZSSHESCAPE should contain only two characters of the form
`^X', meaning that ^X is to be the new escape sequence.
.PD
.PP
.SH REQUIREMENTS
.LP
the following binaries need to be properly installed for zssh to work :
.TP 10
.B ssh/telnet/...
the remote shell to be executed (local machine)
.TP
.B sz rz
zmodem send and receive programs. Should be both on local and remote machine, and
(hopefully) of compatible versions.
.LP
.SH TIPS
.LP
If file transfer is initiated but never completes
.br
( ie a line like :
Bytes Sent: 38144/4610624 BPS:3424 ETA 22:15
or
Bytes Sent: 0/ 513 BPS:0 ETA 00:00 Retry 0: Got ZCAN
can be seen, but transfer never completes
.br
)
.br
Chances are the pty/tty on one of the systems are not 8-bit clean.
(Linux is 8-bit clean, NetBSD is not).
.br
Using the -e (escape) option of rz should solve this problem.
Transfers can be interrupted with ^C (somewhat experimental =)
If you get stuck in rz/sz (for example you've just ran rz, but you then
decided not to transmit anything), hit a dozen ^X (Ctrl-X, not the zssh escape!) to stop it
Use `sz -y <files>' to overwrite files on the other side
.SH BUGS / LIMITATIONS
.LP
You may sometimes have to hit return 2 or 3 times after file transfer
completion in order get back to the shell. Some digits are usually
displayed; don't worry it won't harm (you or your term) ...
the tty may (sometimes) be somewhat upset after an interrupted transfer (
using ^C ). typing `reset' in this case should help.
no pipe, redirection (and other stuff) support in shell ...
but after all there are already wonderful shells around =)
.SH CREDITS
ttssh's author - Robert O'Callahan - for the original idea
The sourceforge team.
.SH AUTHOR
Matthieu Lucotte <gounter@users.sourceforge.net>
Zero King <l2dy@users.sourceforge.net>
.SH SEE ALSO
.BR ssh (1),
.BR telnet (1),
.BR scp (1),
.BR sz (1),
.BR rz (1),
.BR readline (3),