summaryrefslogtreecommitdiff
path: root/usr/src/man/man1/sftp.sunssh.1
blob: 3e7a285660e0a1282afa48cd2ea8136a82fe6ffb (plain)
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
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
'\" te
.\" To view license terms, attribution, and copyright for OpenSSH, the default path is /var/sadm/pkg/SUNWsshdr/install/copyright. If the Solaris operating environment has been installed anywhere other than the default, modify the specified path to access
.\" the file at the installed location.
.\" Portions Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
.TH SFTP 1 "Nov 8, 2007"
.SH NAME
sftp \- secure file transfer program
.SH SYNOPSIS
.LP
.nf
\fBsftp\fR [\fB-1Cv\fR] [\fB-B\fR \fIbuffer_size\fR] [\fB-b\fR \fIbatchfile\fR] [\fB-F\fR \fIssh_config\fR]
      [\fB-o\fR \fIssh_option\fR] [\fB-P\fR \fIsftp_server_path\fR] [\fB-R\fR \fInum_requests\fR]
      [\fB-S\fR \fIprogram\fR] [\fB-s\fR \fIsubsystem\fR | \fIsftp_server\fR] \fIhost\fR
.fi

.LP
.nf
\fBsftp\fR [[\fIuser\fR\fB@\fR]\fIhost\fR[\fB:\fR\fIfile\fR [\fIfile\fR]]]
.fi

.LP
.nf
\fBsftp\fR [[\fIuser\fR\fB@\fR]\fIhost\fR[:\fIdir\fR[\fB/\fR]]]
.fi

.LP
.nf
\fBsftp\fR \fB-b\fR \fIbatchfile\fR [\fIuser\fR\fB@\fR]\fIhost\fR
.fi

.SH DESCRIPTION
.LP
The \fBsftp\fR utility is an interactive file transfer program with a user
interface similar to \fBftp\fR(1) that uses the \fBssh\fR(1) command to create
a secure connection to the server.
.sp
.LP
\fBsftp\fR implements the SSH File Transfer Protocol as defined in IETF
\fBdraft-ietf-secsh-filexfer\fR. There is no relationship between the protocol
used by \fBsftp\fR and the FTP protocol (\fIRFC 959\fR) provided by
\fBftp\fR(1).
.sp
.LP
The first usage format causes \fBsftp\fR to connect to the specified host and
enter an interactive mode. If a username was provided then \fBsftp\fR tries to
log in as the specified user. If a directory is provided then \fBsftp\fR tries
to change the current directory on the server to the specified directory before
entering the interactive mode.
.sp
.LP
The second usage format retrieves the specified file from the server and copies
it to the specified target file or directory on the client. If a username is
specified \fBsftp\fR tries to log in as the specified user.
.SH OPTIONS
.LP
The following options are supported:
.sp
.ne 2
.na
\fB\fB-b\fR \fIbatchfile\fR\fR
.ad
.RS 30n
Batch mode reads a series of commands from an input \fIbatchfile\fR instead of
\fBstdin\fR. Since it lacks user interaction, it should be used in conjunction
with non-interactive authentication. A batchfile of \fB-\fR can be used to
indicate standard input. \fBsftp\fR aborts if any of the following commands
fail: \fBget\fR, \fBput\fR, \fBrm\fR, \fBrename\fR, \fBln\fR, \fBrm\fR,
\fBmkdir\fR, \fBchdir\fR, \fBls\fR, \fBlchdir\fR, \fBchmod\fR, \fBchown\fR,
\fBchgrp\fR, \fBlpwd\fR, and \fBlmkdir\fR. Termination on error can be
suppressed on a command by command basis by prefixing the command with a
\fB-\fR character (for example, \fB-rm /tmp/blah*\fR).
.RE

.sp
.ne 2
.na
\fB\fB-B\fR \fIbuffer_size\fR\fR
.ad
.RS 30n
Specifies the size of the buffer that \fBsftp\fR uses when transferring files.
Larger buffers require fewer round trips at the cost of higher memory
consumption. The default is 32768 bytes.
.RE

.sp
.ne 2
.na
\fB\fB-C\fR\fR
.ad
.RS 30n
Enables compression, using the \fB-C\fR flag in \fBssh\fR(1).
.RE

.sp
.ne 2
.na
\fB\fB-F\fR \fIssh_config\fR\fR
.ad
.RS 30n
Specifies an alternative per-user configuration file for \fBssh\fR. This option
is directly passed to \fBssh\fR(1).
.RE

.sp
.ne 2
.na
\fB\fB-o\fR \fIssh_option\fR\fR
.ad
.RS 30n
Specifies an option to be directly passed to \fBssh\fR(1).
.RE

.sp
.ne 2
.na
\fB\fB-P\fR \fIsftp_server path\fR\fR
.ad
.RS 30n
Executes the specified path as an \fIsftp-server\fR and uses a pipe, rather
than an \fBssh\fR connection, to communicate with it. This option can be useful
in debugging the \fBsftp\fR client and server. The \fB-P\fR and \fB-S\fR
options are mutually exclusive.
.RE

.sp
.ne 2
.na
\fB\fB-R\fR \fInum_requests\fR\fR
.ad
.RS 30n
Specifies how many requests can be outstanding at any one time. Increasing this
can slightly improve file transfer speed but increases memory usage. The
default is 16 outstanding requests.
.RE

.sp
.ne 2
.na
\fB\fB-s\fR \fIsubsystem\fR | \fIsftp_server\fR\fR
.ad
.RS 30n
Specifies the \fBSSH2\fR subsystem or the path for an \fBsftp\fR server on the
remote host. A path is useful for using \fBsftp\fR over protocol version 1, or
when the remote \fBsshd\fR does not have an \fBsftp\fR subsystem configured.
.RE

.sp
.ne 2
.na
\fB\fB-S\fR \fIssh_program\fR \fIpath\fR\fR
.ad
.RS 30n
Uses the specified program instead of \fBssh\fR(1) to connect to the \fBsftp\fR
server. The \fB-P\fR and \fB-S\fR options are mutually exclusive. The program
must understand \fBssh\fR(1) options.
.RE

.sp
.ne 2
.na
\fB\fB-v\fR\fR
.ad
.RS 30n
Raises logging level. This option is also passed to \fBssh\fR(1).
.RE

.sp
.ne 2
.na
\fB\fB-1\fR\fR
.ad
.RS 30n
Specifies the use of protocol version 1.
.RE

.SH OPERANDS
.LP
The following operands are supported:
.sp
.ne 2
.na
\fB\fIhostname\fR | \fIuser@hostname\fR\fR
.ad
.RS 28n
The name of the host to which \fBsftp\fR connects and logs into.
.RE

.SH INTERACTIVE COMMANDS
.LP
Once in interactive mode, \fBsftp\fR understands a set of commands similar to
those of \fBftp\fR(1). Commands are case insensitive and path names can be
enclosed in quotes if they contain spaces.
.sp
.ne 2
.na
\fB\fBbye\fR\fR
.ad
.sp .6
.RS 4n
Quits \fBsftp\fR.
.RE

.sp
.ne 2
.na
\fB\fBcd\fR \fIpath\fR\fR
.ad
.sp .6
.RS 4n
Changes remote directory to \fIpath\fR.
.RE

.sp
.ne 2
.na
\fB\fBchgrp\fR \fIgrp path\fR\fR
.ad
.sp .6
.RS 4n
Changes group of file \fIpath\fR to \fIgrp\fR. \fIgrp\fR must be a numeric
\fBGID\fR.
.RE

.sp
.ne 2
.na
\fB\fBchmod\fR \fImode path\fR\fR
.ad
.sp .6
.RS 4n
Changes permissions of file \fIpath\fR to \fImode\fR.
.RE

.sp
.ne 2
.na
\fB\fBchown\fR \fIown path\fR\fR
.ad
.sp .6
.RS 4n
Changes owner of file \fIpath\fR to \fIown\fR. \fIown\fR must be a numeric
\fBUID\fR.
.RE

.sp
.ne 2
.na
\fB\fBexit\fR\fR
.ad
.sp .6
.RS 4n
Quits \fBsftp\fR.
.RE

.sp
.ne 2
.na
\fB\fBget\fR [\fIflags\fR] \fIremote-path\fR [\fIlocal-path\fR]\fR
.ad
.sp .6
.RS 4n
Retrieves the \fIremote-path\fR and stores it on the local machine. If the
local path name is not specified, it is specified the same name it has on the
remote machine. If the \fB-P\fR flag is specified, then the file's full
permission and access time are copied too.
.RE

.sp
.ne 2
.na
\fB\fBhelp\fR\fR
.ad
.sp .6
.RS 4n
Displays help text.
.sp
Identical to the \fB?\fR command.
.RE

.sp
.ne 2
.na
\fB\fBlcd\fR \fIpath\fR\fR
.ad
.sp .6
.RS 4n
Changes local directory to \fIpath\fR.
.RE

.sp
.ne 2
.na
\fB\fBlls\fR [\fIls-options\fR [\fIpath\fR]]\fR
.ad
.sp .6
.RS 4n
Displays local directory listing of either \fIpath\fR or current directory if
\fIpath\fR is not specified.
.RE

.sp
.ne 2
.na
\fB\fBlmkdir\fR \fIpath\fR\fR
.ad
.sp .6
.RS 4n
Creates local directory specified by \fIpath\fR.
.RE

.sp
.ne 2
.na
\fB\fBln\fR \fIoldpath\fR \fInewpath\fR\fR
.ad
.sp .6
.RS 4n
Creates a link from \fIoldpath\fR to \fInewpath\fR.
.RE

.sp
.ne 2
.na
\fB\fBlpwd\fR\fR
.ad
.sp .6
.RS 4n
Prints local working directory.
.RE

.sp
.ne 2
.na
\fB\fBls\fR [\fB-1aflnrSt\fR] [\fIpath\fR]\fR
.ad
.sp .6
.RS 4n
Displays remote directory listing of either \fIpath\fR or current directory if
\fIpath\fR is not specified. \fIpath\fR can contain wildcards.
.sp
The \fBls\fR supports the following options:
.sp
.ne 2
.na
\fB\fB-a\fR\fR
.ad
.RS 6n
Lists files beginning with a dot (\fB\&.\fR).
.RE

.sp
.ne 2
.na
\fB\fB-f\fR\fR
.ad
.RS 6n
Does not sort the listing. The default sort order is lexicographical.
.RE

.sp
.ne 2
.na
\fB\fB-l\fR\fR
.ad
.RS 6n
Displays additional details including permissions and ownership information.
.RE

.sp
.ne 2
.na
\fB\fB-n\fR\fR
.ad
.RS 6n
Produces a long listing with user and group information presented numerically.
.RE

.sp
.ne 2
.na
\fB\fB-r\fR\fR
.ad
.RS 6n
Reverses the sort order of the listing.
.RE

.sp
.ne 2
.na
\fB\fB-S\fR\fR
.ad
.RS 6n
Sorts the listing by file size.
.RE

.sp
.ne 2
.na
\fB\fB-t\fR\fR
.ad
.RS 6n
Sorts the listing by last modification time.
.RE

.sp
.ne 2
.na
\fB\fB-1\fR\fR
.ad
.RS 6n
Produces single column output.
.RE

.RE

.sp
.ne 2
.na
\fB\fBlumask\fR \fIumask\fR\fR
.ad
.sp .6
.RS 4n
Sets local \fBumask\fR to \fIumask\fR.
.RE

.sp
.ne 2
.na
\fB\fBmkdir\fR \fIpath\fR\fR
.ad
.sp .6
.RS 4n
Creates remote directory specified by \fIpath\fR.
.RE

.sp
.ne 2
.na
\fB\fBput\fR [\fIflags\fR] \fIlocal-path\fR [\fIlocal-path\fR]\fR
.ad
.sp .6
.RS 4n
Uploads \fIlocal-path\fR and stores it on the remote machine. If the remote
path name is not specified, it is specified the same name it has on the local
machine. If the \fB-P\fR flag is specified, then the file's full permission and
access time are copied too.
.RE

.sp
.ne 2
.na
\fB\fBpwd\fR\fR
.ad
.sp .6
.RS 4n
Displays remote working directory.
.RE

.sp
.ne 2
.na
\fB\fBquit\fR\fR
.ad
.sp .6
.RS 4n
Quits \fBsftp\fR.
.RE

.sp
.ne 2
.na
\fB\fBrename\fR \fIoldpath newpath\fR\fR
.ad
.sp .6
.RS 4n
Renames remote file from \fIoldpath\fR to \fInewpath\fR.
.RE

.sp
.ne 2
.na
\fB\fBrm\fR \fIpath\fR\fR
.ad
.sp .6
.RS 4n
Deletes remote file specified by \fIpath\fR.
.RE

.sp
.ne 2
.na
\fB\fBrmdir\fR \fIpath\fR\fR
.ad
.sp .6
.RS 4n
Removes remote directory specified by \fIpath\fR.
.RE

.sp
.ne 2
.na
\fB\fBsymlink\fR \fIoldpath\fR \fInewpath\fR\fR
.ad
.sp .6
.RS 4n
Creates a symbolic link from \fIoldpath\fR to \fInewpath\fR.
.RE

.sp
.ne 2
.na
\fB\fBversion\fR\fR
.ad
.sp .6
.RS 4n
Displays the \fBsftp\fR protocol version.
.RE

.sp
.ne 2
.na
\fB\fB#\fR [\fIcomment\fR]\fR
.ad
.sp .6
.RS 4n
Include a comment. This is useful in batch files.
.RE

.sp
.ne 2
.na
\fB\fB!\fR [\fIcommand\fR]\fR
.ad
.sp .6
.RS 4n
If \fIcommand\fR is not specified, escapes to the local shell.
.sp
If \fIcommand\fR is specified, executes \fIcommand\fR in the local shell.
.RE

.sp
.ne 2
.na
\fB\fB?\fR\fR
.ad
.sp .6
.RS 4n
Displays help text.
.sp
Identical to the \fBhelp\fR command.
.RE

.SH EXIT STATUS
.LP
The following exit values are returned:
.sp
.ne 2
.na
\fB\fB0\fR\fR
.ad
.RS 6n
Successful completion.
.RE

.sp
.ne 2
.na
\fB\fB>0\fR\fR
.ad
.RS 6n
An error occurred.
.RE

.SH ATTRIBUTES
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Interface Stability	Committed
.TE

.SH SEE ALSO
.LP
\fBftp\fR(1), \fBscp\fR(1), \fBssh\fR(1), \fBssh-add\fR(1),
\fBssh-keygen\fR(1), \fBsshd\fR(1M), \fBattributes\fR(5)