[BACK]Return to sftp.1 CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Annotation of src/usr.bin/ssh/sftp.1, Revision 1.141

1.141   ! djm         1: .\" $OpenBSD: sftp.1,v 1.140 2022/03/31 17:27:27 naddy Exp $
1.1       djm         2: .\"
1.9       deraadt     3: .\" Copyright (c) 2001 Damien Miller.  All rights reserved.
1.1       djm         4: .\"
                      5: .\" Redistribution and use in source and binary forms, with or without
                      6: .\" modification, are permitted provided that the following conditions
                      7: .\" are met:
                      8: .\" 1. Redistributions of source code must retain the above copyright
                      9: .\"    notice, this list of conditions and the following disclaimer.
                     10: .\" 2. Redistributions in binary form must reproduce the above copyright
                     11: .\"    notice, this list of conditions and the following disclaimer in the
                     12: .\"    documentation and/or other materials provided with the distribution.
                     13: .\"
                     14: .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
                     15: .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
                     16: .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
                     17: .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
                     18: .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
                     19: .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
                     20: .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
                     21: .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
                     22: .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
                     23: .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
                     24: .\"
1.140     naddy      25: .Dd $Mdocdate: March 31 2022 $
1.1       djm        26: .Dt SFTP 1
                     27: .Os
                     28: .Sh NAME
                     29: .Nm sftp
1.128     jmc        30: .Nd OpenSSH secure file transfer
1.1       djm        31: .Sh SYNOPSIS
1.43      jmc        32: .Nm sftp
1.132     djm        33: .Op Fl 46AaCfNpqrv
1.46      jmc        34: .Op Fl B Ar buffer_size
1.29      markus     35: .Op Fl b Ar batchfile
1.70      djm        36: .Op Fl c Ar cipher
1.141   ! djm        37: .Op Fl D Ar sftp_server_command
1.46      jmc        38: .Op Fl F Ar ssh_config
1.73      jmc        39: .Op Fl i Ar identity_file
1.124     tb         40: .Op Fl J Ar destination
1.85      djm        41: .Op Fl l Ar limit
1.29      markus     42: .Op Fl o Ar ssh_option
1.72      djm        43: .Op Fl P Ar port
1.30      djm        44: .Op Fl R Ar num_requests
1.26      stevesk    45: .Op Fl S Ar program
1.46      jmc        46: .Op Fl s Ar subsystem | sftp_server
1.111     millert    47: .Ar destination
1.1       djm        48: .Sh DESCRIPTION
                     49: .Nm
1.111     millert    50: is a file transfer program, similar to
1.1       djm        51: .Xr ftp 1 ,
                     52: which performs all operations over an encrypted
                     53: .Xr ssh 1
                     54: transport.
                     55: It may also use many features of ssh, such as public key authentication and
                     56: compression.
1.111     millert    57: .Pp
                     58: The
                     59: .Ar destination
                     60: may be specified either as
1.112     jmc        61: .Sm off
                     62: .Oo user @ Oc host Op : path
                     63: .Sm on
                     64: or as a URI in the form
                     65: .Sm off
                     66: .No sftp:// Oo user @ Oc host Oo : port Oc Op / path .
                     67: .Sm on
1.111     millert    68: .Pp
                     69: If the
                     70: .Ar destination
                     71: includes a
                     72: .Ar path
                     73: and it is not a directory,
1.1       djm        74: .Nm
1.111     millert    75: will retrieve files automatically if a non-interactive
1.18      stevesk    76: authentication method is used; otherwise it will do so after
                     77: successful interactive authentication.
1.15      mouring    78: .Pp
1.111     millert    79: If no
                     80: .Ar path
                     81: is specified, or if the
                     82: .Ar path
                     83: is a directory,
1.60      jaredy     84: .Nm
1.111     millert    85: will log in to the specified
                     86: .Ar host
                     87: and enter interactive command mode, changing to the remote directory
                     88: if one was specified.
                     89: An optional trailing slash can be used to force the
                     90: .Ar path
                     91: to be interpreted as a directory.
1.1       djm        92: .Pp
1.111     millert    93: Since the destination formats use colon characters to delimit host
                     94: names from path names or port numbers, IPv6 addresses must be
                     95: enclosed in square brackets to avoid ambiguity.
1.89      djm        96: .Pp
1.1       djm        97: The options are as follows:
                     98: .Bl -tag -width Ds
1.70      djm        99: .It Fl 4
                    100: Forces
                    101: .Nm
                    102: to use IPv4 addresses only.
                    103: .It Fl 6
                    104: Forces
                    105: .Nm
                    106: to use IPv6 addresses only.
1.132     djm       107: .It Fl A
                    108: Allows forwarding of
                    109: .Xr ssh-agent 1
                    110: to the remote system.
                    111: The default is not to forward an authentication agent.
1.94      jmc       112: .It Fl a
1.99      jmc       113: Attempt to continue interrupted transfers rather than overwriting
1.98      logan     114: existing partial or complete copies of files.
1.99      jmc       115: If the partial contents differ from those being transferred,
1.98      logan     116: then the resultant file is likely to be corrupt.
1.46      jmc       117: .It Fl B Ar buffer_size
                    118: Specify the size of the buffer that
                    119: .Nm
                    120: uses when transferring files.
                    121: Larger buffers require fewer round trips at the cost of higher
                    122: memory consumption.
                    123: The default is 32768 bytes.
1.10      deraadt   124: .It Fl b Ar batchfile
                    125: Batch mode reads a series of commands from an input
1.13      stevesk   126: .Ar batchfile
1.10      deraadt   127: instead of
1.13      stevesk   128: .Em stdin .
1.140     naddy     129: Since it lacks user interaction, it should be used in conjunction with
1.111     millert   130: non-interactive authentication to obviate the need to enter a password
                    131: at connection time (see
                    132: .Xr sshd 8
                    133: and
                    134: .Xr ssh-keygen 1
                    135: for details).
1.122     djm       136: .Pp
1.50      djm       137: A
1.51      jmc       138: .Ar batchfile
                    139: of
                    140: .Sq \-
1.50      djm       141: may be used to indicate standard input.
1.13      stevesk   142: .Nm
1.21      itojun    143: will abort if any of the following
                    144: commands fail:
1.121     schwarze  145: .Ic get , put , reget , reput , rename , ln ,
1.41      jmc       146: .Ic rm , mkdir , chdir , ls ,
1.139     djm       147: .Ic lchdir , copy , cp , chmod , chown ,
1.88      djm       148: .Ic chgrp , lpwd , df , symlink ,
1.10      deraadt   149: and
1.13      stevesk   150: .Ic lmkdir .
1.122     djm       151: .Pp
1.41      jmc       152: Termination on error can be suppressed on a command by command basis by
                    153: prefixing the command with a
1.51      jmc       154: .Sq \-
1.44      jmc       155: character (for example,
                    156: .Ic -rm /tmp/blah* ) .
1.122     djm       157: Echo of the command may be suppressed by prefixing the command with a
                    158: .Sq @
                    159: character.
                    160: These two prefixes may be combined in any order, for example
                    161: .Ic -@ls /bsd .
1.71      jmc       162: .It Fl C
                    163: Enables compression (via ssh's
                    164: .Fl C
                    165: flag).
1.70      djm       166: .It Fl c Ar cipher
                    167: Selects the cipher to use for encrypting the data transfers.
                    168: This option is directly passed to
                    169: .Xr ssh 1 .
1.141   ! djm       170: .It Fl D Ar sftp_server_command
1.72      djm       171: Connect directly to a local sftp server
                    172: (rather than via
                    173: .Xr ssh 1 ) .
1.141   ! djm       174: A command and arguments may be specified, for example
        !           175: .Qq /path/sftp-server -el debug3 .
1.72      djm       176: This option may be useful in debugging the client and server.
1.46      jmc       177: .It Fl F Ar ssh_config
                    178: Specifies an alternative
                    179: per-user configuration file for
                    180: .Xr ssh 1 .
                    181: This option is directly passed to
                    182: .Xr ssh 1 .
1.95      djm       183: .It Fl f
                    184: Requests that files be flushed to disk immediately after transfer.
                    185: When uploading files, this feature is only enabled if the server
                    186: implements the "fsync@openssh.com" extension.
1.70      djm       187: .It Fl i Ar identity_file
                    188: Selects the file from which the identity (private key) for public key
                    189: authentication is read.
1.124     tb        190: This option is directly passed to
                    191: .Xr ssh 1 .
                    192: .It Fl J Ar destination
1.125     jmc       193: Connect to the target host by first making an
1.124     tb        194: .Nm
                    195: connection to the jump host described by
                    196: .Ar destination
                    197: and then establishing a TCP forwarding to the ultimate destination from
                    198: there.
                    199: Multiple jump hops may be specified separated by comma characters.
                    200: This is a shortcut to specify a
                    201: .Cm ProxyJump
                    202: configuration directive.
1.70      djm       203: This option is directly passed to
                    204: .Xr ssh 1 .
1.85      djm       205: .It Fl l Ar limit
                    206: Limits the used bandwidth, specified in Kbit/s.
1.130     jmc       207: .It Fl N
                    208: Disables quiet mode, e.g. to override the implicit quiet mode set by the
                    209: .Fl b
                    210: flag.
1.1       djm       211: .It Fl o Ar ssh_option
1.23      stevesk   212: Can be used to pass options to
                    213: .Nm ssh
1.35      stevesk   214: in the format used in
                    215: .Xr ssh_config 5 .
                    216: This is useful for specifying options
1.23      stevesk   217: for which there is no separate
                    218: .Nm sftp
1.44      jmc       219: command-line flag.
                    220: For example, to specify an alternate port use:
1.26      stevesk   221: .Ic sftp -oPort=24 .
1.46      jmc       222: For full details of the options listed below, and their possible values, see
                    223: .Xr ssh_config 5 .
                    224: .Pp
                    225: .Bl -tag -width Ds -offset indent -compact
                    226: .It AddressFamily
                    227: .It BatchMode
                    228: .It BindAddress
1.114     jmc       229: .It BindInterface
1.97      djm       230: .It CanonicalDomains
                    231: .It CanonicalizeFallbackLocal
                    232: .It CanonicalizeHostname
                    233: .It CanonicalizeMaxDots
                    234: .It CanonicalizePermittedCNAMEs
1.120     jmc       235: .It CASignatureAlgorithms
1.102     jmc       236: .It CertificateFile
1.46      jmc       237: .It CheckHostIP
                    238: .It Ciphers
                    239: .It Compression
1.110     naddy     240: .It ConnectionAttempts
1.54      dtucker   241: .It ConnectTimeout
1.55      djm       242: .It ControlMaster
                    243: .It ControlPath
1.91      djm       244: .It ControlPersist
1.46      jmc       245: .It GlobalKnownHostsFile
                    246: .It GSSAPIAuthentication
                    247: .It GSSAPIDelegateCredentials
1.61      jmc       248: .It HashKnownHosts
1.46      jmc       249: .It Host
1.136     naddy     250: .It HostbasedAcceptedAlgorithms
1.46      jmc       251: .It HostbasedAuthentication
                    252: .It HostKeyAlgorithms
                    253: .It HostKeyAlias
1.126     jmc       254: .It Hostname
1.104     jmc       255: .It IdentitiesOnly
1.103     markus    256: .It IdentityAgent
1.46      jmc       257: .It IdentityFile
1.87      jmc       258: .It IPQoS
1.91      djm       259: .It KbdInteractiveAuthentication
1.58      djm       260: .It KbdInteractiveDevices
1.86      jmc       261: .It KexAlgorithms
1.133     jmc       262: .It KnownHostsCommand
1.46      jmc       263: .It LogLevel
                    264: .It MACs
                    265: .It NoHostAuthenticationForLocalhost
                    266: .It NumberOfPasswordPrompts
                    267: .It PasswordAuthentication
1.83      markus    268: .It PKCS11Provider
1.46      jmc       269: .It Port
                    270: .It PreferredAuthentications
                    271: .It ProxyCommand
1.105     jmc       272: .It ProxyJump
1.134     dtucker   273: .It PubkeyAcceptedAlgorithms
1.46      jmc       274: .It PubkeyAuthentication
1.63      dtucker   275: .It RekeyLimit
1.53      jmc       276: .It SendEnv
1.49      markus    277: .It ServerAliveInterval
                    278: .It ServerAliveCountMax
1.116     jmc       279: .It SetEnv
1.46      jmc       280: .It StrictHostKeyChecking
1.48      markus    281: .It TCPKeepAlive
1.100     djm       282: .It UpdateHostKeys
1.46      jmc       283: .It User
                    284: .It UserKnownHostsFile
                    285: .It VerifyHostKeyDNS
                    286: .El
1.72      djm       287: .It Fl P Ar port
                    288: Specifies the port to connect to on the remote host.
1.74      djm       289: .It Fl p
                    290: Preserves modification times, access times, and modes from the
                    291: original files transferred.
1.70      djm       292: .It Fl q
                    293: Quiet mode: disables the progress meter as well as warning and
                    294: diagnostic messages from
                    295: .Xr ssh 1 .
1.30      djm       296: .It Fl R Ar num_requests
1.44      jmc       297: Specify how many requests may be outstanding at any one time.
                    298: Increasing this may slightly improve file transfer speed
                    299: but will increase memory usage.
1.67      djm       300: The default is 64 outstanding requests.
1.74      djm       301: .It Fl r
                    302: Recursively copy entire directories when uploading and downloading.
                    303: Note that
                    304: .Nm
                    305: does not follow symbolic links encountered in the tree traversal.
1.26      stevesk   306: .It Fl S Ar program
                    307: Name of the
                    308: .Ar program
                    309: to use for the encrypted connection.
                    310: The program must understand
                    311: .Xr ssh 1
                    312: options.
1.46      jmc       313: .It Fl s Ar subsystem | sftp_server
                    314: Specifies the SSH2 subsystem or the path for an sftp server
                    315: on the remote host.
1.109     jmc       316: A path is useful when the remote
1.46      jmc       317: .Xr sshd 8
                    318: does not have an sftp subsystem configured.
                    319: .It Fl v
                    320: Raise logging level.
                    321: This option is also passed to ssh.
1.1       djm       322: .El
                    323: .Sh INTERACTIVE COMMANDS
1.2       djm       324: Once in interactive mode,
                    325: .Nm
1.21      itojun    326: understands a set of commands similar to those of
1.1       djm       327: .Xr ftp 1 .
1.60      jaredy    328: Commands are case insensitive.
                    329: Pathnames that contain spaces must be enclosed in quotes.
                    330: Any special characters contained within pathnames that are recognized by
                    331: .Xr glob 3
                    332: must be escaped with backslashes
                    333: .Pq Sq \e .
                    334: .Bl -tag -width Ds
1.22      markus    335: .It Ic bye
1.44      jmc       336: Quit
                    337: .Nm sftp .
1.113     djm       338: .It Ic cd Op Ar path
1.21      itojun    339: Change remote directory to
1.3       deraadt   340: .Ar path .
1.113     djm       341: If
                    342: .Ar path
                    343: is not specified, then change directory to the one the session started in.
1.123     djm       344: .It Xo Ic chgrp
                    345: .Op Fl h
                    346: .Ar grp
                    347: .Ar path
                    348: .Xc
1.21      itojun    349: Change group of file
1.5       stevesk   350: .Ar path
                    351: to
1.1       djm       352: .Ar grp .
1.60      jaredy    353: .Ar path
                    354: may contain
1.118     kn        355: .Xr glob 7
1.60      jaredy    356: characters and may match multiple files.
1.1       djm       357: .Ar grp
1.5       stevesk   358: must be a numeric GID.
1.137     djm       359: .Pp
                    360: If the
                    361: .Fl h
                    362: flag is specified, then symlinks will not be followed.
                    363: Note that this is only supported by servers that implement
                    364: the "lsetstat@openssh.com" extension.
1.123     djm       365: .It Xo Ic chmod
                    366: .Op Fl h
                    367: .Ar mode
                    368: .Ar path
                    369: .Xc
1.21      itojun    370: Change permissions of file
1.5       stevesk   371: .Ar path
                    372: to
1.3       deraadt   373: .Ar mode .
1.60      jaredy    374: .Ar path
                    375: may contain
1.118     kn        376: .Xr glob 7
1.60      jaredy    377: characters and may match multiple files.
1.137     djm       378: .Pp
                    379: If the
                    380: .Fl h
                    381: flag is specified, then symlinks will not be followed.
                    382: Note that this is only supported by servers that implement
                    383: the "lsetstat@openssh.com" extension.
1.123     djm       384: .It Xo Ic chown
                    385: .Op Fl h
                    386: .Ar own
                    387: .Ar path
                    388: .Xc
1.21      itojun    389: Change owner of file
1.5       stevesk   390: .Ar path
                    391: to
1.1       djm       392: .Ar own .
1.60      jaredy    393: .Ar path
                    394: may contain
1.118     kn        395: .Xr glob 7
1.60      jaredy    396: characters and may match multiple files.
1.1       djm       397: .Ar own
                    398: must be a numeric UID.
1.137     djm       399: .Pp
                    400: If the
                    401: .Fl h
                    402: flag is specified, then symlinks will not be followed.
                    403: Note that this is only supported by servers that implement
                    404: the "lsetstat@openssh.com" extension.
1.139     djm       405: .It Ic copy Ar oldpath Ar newpath
                    406: Copy remote file from
                    407: .Ar oldpath
                    408: to
                    409: .Ar newpath .
                    410: .Pp
                    411: Note that this is only supported by servers that implement the "copy-data"
                    412: extension.
                    413: .It Ic cp Ar oldpath Ar newpath
                    414: Alias to
                    415: .Ic copy
                    416: command.
1.65      djm       417: .It Xo Ic df
                    418: .Op Fl hi
                    419: .Op Ar path
                    420: .Xc
                    421: Display usage information for the filesystem holding the current directory
                    422: (or
                    423: .Ar path
                    424: if specified).
                    425: If the
                    426: .Fl h
                    427: flag is specified, the capacity information will be displayed using
                    428: "human-readable" suffixes.
                    429: The
                    430: .Fl i
                    431: flag requests display of inode information in addition to capacity information.
                    432: This command is only supported on servers that implement the
                    433: .Dq statvfs@openssh.com
                    434: extension.
1.11      deraadt   435: .It Ic exit
1.44      jmc       436: Quit
                    437: .Nm sftp .
1.7       djm       438: .It Xo Ic get
1.127     jmc       439: .Op Fl afpR
1.7       djm       440: .Ar remote-path
                    441: .Op Ar local-path
                    442: .Xc
1.1       djm       443: Retrieve the
1.5       stevesk   444: .Ar remote-path
1.1       djm       445: and store it on the local machine.
                    446: If the local
1.21      itojun    447: path name is not specified, it is given the same name it has on the
1.44      jmc       448: remote machine.
1.60      jaredy    449: .Ar remote-path
                    450: may contain
1.118     kn        451: .Xr glob 7
1.60      jaredy    452: characters and may match multiple files.
                    453: If it does and
                    454: .Ar local-path
                    455: is specified, then
                    456: .Ar local-path
                    457: must specify a directory.
1.74      djm       458: .Pp
1.92      djm       459: If the
                    460: .Fl a
                    461: flag is specified, then attempt to resume partial transfers of existing files.
                    462: Note that resumption assumes that any partial copy of the local file matches
                    463: the remote copy.
1.93      djm       464: If the remote file contents differ from the partial local copy then the
                    465: resultant file is likely to be corrupt.
1.92      djm       466: .Pp
1.95      djm       467: If the
                    468: .Fl f
                    469: flag is specified, then
                    470: .Xr fsync 2
1.96      jmc       471: will be called after the file transfer has completed to flush the file
1.95      djm       472: to disk.
                    473: .Pp
1.127     jmc       474: If the
1.74      djm       475: .Fl p
1.127     jmc       476: .\" undocumented redundant alias
                    477: .\" or
                    478: .\" .Fl P
1.60      jaredy    479: flag is specified, then full file permissions and access times are
1.7       djm       480: copied too.
1.74      djm       481: .Pp
                    482: If the
1.127     jmc       483: .Fl R
                    484: .\" undocumented redundant alias
                    485: .\" or
                    486: .\" .Fl r
1.74      djm       487: flag is specified then directories will be copied recursively.
                    488: Note that
                    489: .Nm
                    490: does not follow symbolic links when performing recursive transfers.
1.11      deraadt   491: .It Ic help
                    492: Display help text.
1.113     djm       493: .It Ic lcd Op Ar path
1.46      jmc       494: Change local directory to
                    495: .Ar path .
1.113     djm       496: If
                    497: .Ar path
                    498: is not specified, then change directory to the local user's home directory.
1.3       deraadt   499: .It Ic lls Op Ar ls-options Op Ar path
1.21      itojun    500: Display local directory listing of either
1.1       djm       501: .Ar path
                    502: or current directory if
                    503: .Ar path
1.5       stevesk   504: is not specified.
1.60      jaredy    505: .Ar ls-options
                    506: may contain any flags supported by the local system's
                    507: .Xr ls 1
                    508: command.
                    509: .Ar path
                    510: may contain
1.118     kn        511: .Xr glob 7
1.60      jaredy    512: characters and may match multiple files.
1.3       deraadt   513: .It Ic lmkdir Ar path
1.1       djm       514: Create local directory specified by
1.3       deraadt   515: .Ar path .
1.88      djm       516: .It Xo Ic ln
                    517: .Op Fl s
                    518: .Ar oldpath
                    519: .Ar newpath
                    520: .Xc
                    521: Create a link from
1.12      djm       522: .Ar oldpath
                    523: to
                    524: .Ar newpath .
1.88      djm       525: If the
                    526: .Fl s
                    527: flag is specified the created link is a symbolic link, otherwise it is
                    528: a hard link.
1.3       deraadt   529: .It Ic lpwd
                    530: Print local working directory.
1.36      djm       531: .It Xo Ic ls
1.82      jmc       532: .Op Fl 1afhlnrSt
1.36      djm       533: .Op Ar path
                    534: .Xc
1.60      jaredy    535: Display a remote directory listing of either
1.1       djm       536: .Ar path
1.60      jaredy    537: or the current directory if
1.5       stevesk   538: .Ar path
1.44      jmc       539: is not specified.
1.60      jaredy    540: .Ar path
                    541: may contain
1.118     kn        542: .Xr glob 7
1.60      jaredy    543: characters and may match multiple files.
                    544: .Pp
                    545: The following flags are recognized and alter the behaviour of
                    546: .Ic ls
                    547: accordingly:
                    548: .Bl -tag -width Ds
                    549: .It Fl 1
                    550: Produce single columnar output.
                    551: .It Fl a
                    552: List files beginning with a dot
                    553: .Pq Sq \&. .
                    554: .It Fl f
                    555: Do not sort the listing.
                    556: The default sort order is lexicographical.
1.81      djm       557: .It Fl h
                    558: When used with a long format option, use unit suffixes: Byte, Kilobyte,
                    559: Megabyte, Gigabyte, Terabyte, Petabyte, and Exabyte in order to reduce
                    560: the number of digits to four or fewer using powers of 2 for sizes (K=1024,
                    561: M=1048576, etc.).
1.82      jmc       562: .It Fl l
                    563: Display additional details including permissions
                    564: and ownership information.
1.60      jaredy    565: .It Fl n
                    566: Produce a long listing with user and group information presented
1.56      djm       567: numerically.
1.60      jaredy    568: .It Fl r
                    569: Reverse the sort order of the listing.
                    570: .It Fl S
                    571: Sort the listing by file size.
                    572: .It Fl t
                    573: Sort the listing by last modification time.
                    574: .El
1.3       deraadt   575: .It Ic lumask Ar umask
1.21      itojun    576: Set local umask to
1.3       deraadt   577: .Ar umask .
                    578: .It Ic mkdir Ar path
1.1       djm       579: Create remote directory specified by
1.3       deraadt   580: .Ar path .
1.40      fgsch     581: .It Ic progress
                    582: Toggle display of progress meter.
1.7       djm       583: .It Xo Ic put
1.127     jmc       584: .Op Fl afpR
1.7       djm       585: .Ar local-path
1.37      djm       586: .Op Ar remote-path
1.7       djm       587: .Xc
1.1       djm       588: Upload
1.5       stevesk   589: .Ar local-path
1.44      jmc       590: and store it on the remote machine.
                    591: If the remote path name is not specified, it is given the same name it has
                    592: on the local machine.
1.60      jaredy    593: .Ar local-path
                    594: may contain
1.118     kn        595: .Xr glob 7
1.60      jaredy    596: characters and may match multiple files.
                    597: If it does and
                    598: .Ar remote-path
                    599: is specified, then
                    600: .Ar remote-path
                    601: must specify a directory.
1.95      djm       602: .Pp
                    603: If the
1.99      jmc       604: .Fl a
1.98      logan     605: flag is specified, then attempt to resume partial
                    606: transfers of existing files.
1.99      jmc       607: Note that resumption assumes that any partial copy of the remote file
1.98      logan     608: matches the local copy.
                    609: If the local file contents differ from the remote local copy then
                    610: the resultant file is likely to be corrupt.
                    611: .Pp
                    612: If the
1.95      djm       613: .Fl f
                    614: flag is specified, then a request will be sent to the server to call
                    615: .Xr fsync 2
                    616: after the file has been transferred.
                    617: Note that this is only supported by servers that implement
                    618: the "fsync@openssh.com" extension.
1.74      djm       619: .Pp
1.127     jmc       620: If the
1.74      djm       621: .Fl p
1.127     jmc       622: .\" undocumented redundant alias
                    623: .\" or
                    624: .\" .Fl P
1.74      djm       625: flag is specified, then full file permissions and access times are
1.7       djm       626: copied too.
1.74      djm       627: .Pp
                    628: If the
1.127     jmc       629: .Fl R
                    630: .\" undocumented redundant alias
                    631: .\" or
                    632: .\" .Fl r
1.74      djm       633: flag is specified then directories will be copied recursively.
                    634: Note that
                    635: .Nm
                    636: does not follow symbolic links when performing recursive transfers.
1.3       deraadt   637: .It Ic pwd
                    638: Display remote working directory.
                    639: .It Ic quit
1.44      jmc       640: Quit
                    641: .Nm sftp .
1.92      djm       642: .It Xo Ic reget
1.127     jmc       643: .Op Fl fpR
1.92      djm       644: .Ar remote-path
                    645: .Op Ar local-path
                    646: .Xc
                    647: Resume download of
                    648: .Ar remote-path .
                    649: Equivalent to
                    650: .Ic get
                    651: with the
1.98      logan     652: .Fl a
                    653: flag set.
                    654: .It Xo Ic reput
1.127     jmc       655: .Op Fl fpR
                    656: .Ar local-path
                    657: .Op Ar remote-path
1.98      logan     658: .Xc
                    659: Resume upload of
1.127     jmc       660: .Ar local-path .
1.98      logan     661: Equivalent to
                    662: .Ic put
1.99      jmc       663: with the
1.92      djm       664: .Fl a
                    665: flag set.
1.131     jmc       666: .It Ic rename Ar oldpath newpath
1.1       djm       667: Rename remote file from
                    668: .Ar oldpath
                    669: to
1.3       deraadt   670: .Ar newpath .
1.46      jmc       671: .It Ic rm Ar path
                    672: Delete remote file specified by
                    673: .Ar path .
1.3       deraadt   674: .It Ic rmdir Ar path
1.1       djm       675: Remove remote directory specified by
1.3       deraadt   676: .Ar path .
1.131     jmc       677: .It Ic symlink Ar oldpath newpath
1.21      itojun    678: Create a symbolic link from
1.12      djm       679: .Ar oldpath
                    680: to
                    681: .Ar newpath .
1.38      fgsch     682: .It Ic version
                    683: Display the
                    684: .Nm
                    685: protocol version.
1.69      sobrado   686: .It Ic \&! Ns Ar command
1.21      itojun    687: Execute
1.1       djm       688: .Ar command
1.3       deraadt   689: in local shell.
1.45      jmc       690: .It Ic \&!
1.3       deraadt   691: Escape to local shell.
1.45      jmc       692: .It Ic \&?
1.5       stevesk   693: Synonym for help.
1.4       itojun    694: .El
1.1       djm       695: .Sh SEE ALSO
1.46      jmc       696: .Xr ftp 1 ,
1.60      jaredy    697: .Xr ls 1 ,
1.17      markus    698: .Xr scp 1 ,
1.1       djm       699: .Xr ssh 1 ,
                    700: .Xr ssh-add 1 ,
                    701: .Xr ssh-keygen 1 ,
1.119     jmc       702: .Xr ssh_config 5 ,
1.118     kn        703: .Xr glob 7 ,
1.17      markus    704: .Xr sftp-server 8 ,
                    705: .Xr sshd 8
                    706: .Rs
1.20      deraadt   707: .%A T. Ylonen
                    708: .%A S. Lehtinen
1.17      markus    709: .%T "SSH File Transfer Protocol"
                    710: .%N draft-ietf-secsh-filexfer-00.txt
                    711: .%D January 2001
                    712: .%O work in progress material
                    713: .Re