SFTP(1) | General Commands Manual | SFTP(1) |
sftp
—
sftp |
[-1246Capqrv ]
[-B buffer_size]
[-b batchfile]
[-c cipher]
[-D sftp_server_path]
[-F ssh_config]
[-i identity_file]
[-l limit]
[-o ssh_option]
[-P port]
[-R num_requests]
[-S program]
[-s subsystem | sftp_server] host |
sftp |
[user@]host[:file ...] |
sftp |
[user@]host[:dir[/]] |
sftp |
-b batchfile
[user@]host |
sftp
is an interactive file transfer program, similar to
ftp(1), which performs all operations over an encrypted
ssh(1) transport. It may also use many features of ssh, such
as public key authentication and compression. sftp
connects and logs into the specified host, then enters
an interactive command mode.
The second usage format will retrieve files automatically if a non-interactive authentication method is used; otherwise it will do so after successful interactive authentication.
The third usage format allows sftp
to
start in a remote directory.
The final usage format allows for automated sessions using the
-b
option. In such cases, it is necessary to
configure non-interactive authentication to obviate the need to enter a
password at connection time (see sshd(8) and
ssh-keygen(1) for details).
Since some usage formats use colon characters to delimit host names from path names, IPv6 addresses must be enclosed in square brackets to avoid ambiguity.
The options are as follows:
-1
-2
-4
sftp
to use IPv4 addresses only.-6
sftp
to use IPv6 addresses only.-B
buffer_sizesftp
uses when
transferring files. Larger buffers require fewer round trips at the cost
of higher memory consumption. The default is 32768 bytes.-a
-b
batchfilesftp
will abort if any of the following commands
fail: get
, put
,
reget
, rename
,
ln
, rm
,
mkdir
, chdir
,
ls
, lchdir
,
chmod
, chown
,
chgrp
, lpwd
,
df
, symlink
, and
lmkdir
. Termination on error can be suppressed on
a command by command basis by prefixing the command with a
‘-’ character (for example, -rm
/tmp/blah*
).-C
-C
flag).-c
cipher-D
sftp_server_path-F
ssh_config-i
identity_file-l
limit-o
ssh_optionssh
in the format
used in ssh_config(5). This is useful for specifying
options for which there is no separate sftp
command-line flag. For example, to specify an alternate port use:
sftp -oPort=24
. For full details of the options
listed below, and their possible values, see
ssh_config(5).
-P
port-p
-q
-R
num_requests-r
sftp
does not follow symbolic links
encountered in the tree traversal.-S
program-s
subsystem | sftp_serversftp
over
protocol version 1, or when the remote sshd(8) does not
have an sftp subsystem configured.-v
sftp
understands a set of
commands similar to those of ftp(1). Commands are case
insensitive. Pathnames that contain spaces must be enclosed in quotes. Any
special characters contained within pathnames that are recognized by
glob(3) must be escaped with backslashes
(‘\’).
bye
sftp
.cd
pathchgrp
grp pathchmod
mode pathchown
own pathdf
[-hi
] [path]-h
flag is specified, the capacity information
will be displayed using "human-readable" suffixes. The
-i
flag requests display of inode information in
addition to capacity information. This command is only supported on
servers that implement the “statvfs@openssh.com”
extension.exit
sftp
.get
[-aPpr
] remote-path
[local-path]If the -a
flag is specified, then
attempt to resume partial transfers of existing files. Note that
resumption assumes that any partial copy of the local file matches the
remote copy. If the remote file contents differ from the partial local
copy then the resultant file is likely to be corrupt.
If either the -P
or
-p
flag is specified, then full file permissions
and access times are copied too.
If the -r
flag is specified then
directories will be copied recursively. Note that
sftp
does not follow symbolic links when
performing recursive transfers.
help
lcd
pathlls
[ls-options [path]]lmkdir
pathln
[-s
] oldpath
newpath-s
flag is
specified the created link is a symbolic link, otherwise it is a hard
link.lpwd
ls
[-1afhlnrSt
] [path]The following flags are recognized and alter the behaviour of
ls
accordingly:
-1
-a
-f
-h
-l
-n
-r
-S
-t
lumask
umaskmkdir
pathprogress
put
[-Ppr
] local-path
[remote-path]If either the -P
or
-p
flag is specified, then full file permissions
and access times are copied too.
If the -r
flag is specified then
directories will be copied recursively. Note that
sftp
does not follow symbolic links when
performing recursive transfers.
pwd
quit
sftp
.reget
[-Ppr
] remote-path
[local-path]get
with the -a
flag
set.rename
oldpath newpathrm
pathrmdir
pathsymlink
oldpath newpathversion
sftp
protocol version.!
command!
?
T. Ylonen and S. Lehtinen, SSH File Transfer Protocol, draft-ietf-secsh-filexfer-00.txt, January 2001, work in progress material.
August 6, 2013 | BSD |