sftp

secure file transfer program 

Command


SYNOPSIS

sftp [-1vC] [-F ssh_config] [-b batchfile] [-o ssh_option] [-s subsystem|sftp_server] [-S program] [-o ssh_option] [host]

sftp [[user@]host[:file [file]]]

sftp [[user@]host[:dir[/]]]


DESCRIPTION

sftp is an interactive file transfer program, similar to ftp, which performs all operations over an encrypted secsh transport. It may also use many features of secsh, 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 is used; otherwise, it will do so after successful interactive authentication.

The last usage format allows the sftp client to start in a remote directory.

Options

-1 

Specifies the use of protocol version 1.

-b batchfile 

Batch mode reads a series of commands from an input batchfile instead of stdin. Since it lacks user interaction it should be used in conjunction with non-interactive authentication. sftp will abort if any of the following commands fail: get, put, rename, ln, rm, and lmkdir.

-C 

Enables compression (via secsh's -C flag)

-F ssh_config 

Specifies an alternative per-user configuration file for secsh. This option is directly passed to secsh.

-o ssh_option 

Any valid -o option to secsh can be specified, and it is directly passed through when secsh is invoked. This is useful for specifying options for which there is no separate sftp command-line flag. For example, to specify an alternate port:

sftp -oPort=24
-s subsystem|sftp_server 

Specifies the SSH2 subsystem or the path for an sftp server on the remote host. A path is useful for using sftp over protocol version 1, or when the remote secshd does not have an sftp subsystem configured.

-S program 

Specifies the name of the program to use for the encrypted connection. The program must understand secsh options.

-v 

Raises logging level. This option is also passed to secsh.

Interactive Commands

Once in interactive mode, sftp understands a set of commands similar to those of ftp. Commands are case insensitive and path names may be enclosed in quotes if they contain spaces.

bye 

Quits sftp

cd path 

Changes remote directory to path.

lcd path 

Changes local directory to path.

chgrp grp path 

Changes group of file path to grp. grp must be a numeric GID.

chmod mode path 

Changes permission of file path to mode.

chown own path 

Changes owner of file path to own. own must be a numeric UID.

exit 

Quits sftp.

get [flags] remote-path [loacl-path

Retrieves the remote-path and stores it on the local machine. If the local path name is not specified, it is given the same name it has on the remote machine. If the -P flag is specified, then the file's full permission and access time are copied too.

help 

Displays help text.

lls [ls-options] [path]] 

Displays local directory listing of either path or current directory if path is not specified.

lmkdir path 

Creates local directory specified by path.

ln oldpath newpath 

Creates a symbolic link from oldpath to newpath.

lpwd 

Displays local working directory.

ls [flags] [path

Displays remote directory listing of either path or current directory if path is not specified.

If the -l is specified, this command displays additional details including permissions and ownership information.

lumask umask 

Sets local umask to umask.

mkdir path 

Creates remote directory specified by path.

put [flags] local-path [local-path

Uploads local-path and stores it on the remote machine. If the remote path name is not specified, it is given the same name it has on the local machine. If the -P flag is specified, then the file's full permission and access time are copied too.

pwd 

Displays remote working directory.

quit 

Quits sftp.

rename oldpath newpath 

Renames remote file from oldpath to newpath.

rmdir path 

Removes remote directory specified by path.

rm path 

Deletes remote file specified by path.

symlink oldpath newpath 

Create a symbolic link from oldpath to newpath.

! command 

Executes command in local shell.

! 

Escapes to local shell.

? 

Synonym for help.


AUTHORS

Damien Miller <djm@mindrot.org>


PORTABILITY

All UNIX systems. Windows 2000. Windows XP. Windows Server 2003. Windows Vista.


NOTES

There is no binary/text file transfer mode. All files are transferred in binary mode.

There is no file globbing capability. Thus, ls *.tar will not succeed, unless of course you are a sick and twisted individual who names files *.tar.


AVAILABILITY

MKS Toolkit for System Administrators
MKS Toolkit for Developers
MKS Toolkit for Interoperability
MKS Toolkit for Professional Developers
MKS Toolkit for Enterprise Developers
MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Commands:
scp, secsh, secsh-add, secshd, secsh-keygen, sftp-server

MKS Toolkit Connectivity Solutions Guide

T. Ylonen and S. Lehtinen, SSH File Transfer Protocol, draft-ietf-secsh- filexfer-00.txt, January 2001, work in progress material.


MKS Toolkit 9.2 Documentation Build 16.