![]() sftp Command Line UtilitySyntax: sftp [options] [user@]host[#port]:source_file [user@]host[#port][:destination_file] Note: You can reuse an existing Secure Shell connection. However, to do so you must explicitly enable this on each command line, or set the SSHConnectionReUse environment variable to Yes. For details, see Connection Reuse in Secure Shell Sessions. Command Line Options-aTransfer files in ASCII mode. -b buffersizeSets the maximum buffer size for one request. Valid values are 1024 - 32768. -B batchfileAfter a successful login, executes each command in the specified batch file and then terminates the connection. For example, the following command connects to myhost using myname and executes the commands in myfile. After all commands in the file are executed, the connection is terminated. sftp -B c:\mypath\myfile myhost.com myname The batch file can use any of the interactive commands documented below. Note: Semicolons are not supported for comments in scripts supplied to the sftp command line using the -B option. Use the number sign (#) to mark comments in these batch files. -c cipherA comma-separated list of ciphers specified in order of preference. The default is "aes128-ctr,aes128-cbc,aes192-ctr,aes192-cbc,aes256-ctr,aes256-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour". If the connection is set to run in FIPS mode, the default is "aes128-ctr,aes128-cbc,aes192-ctr,aes192-cbc,aes256-ctr,aes256-cbc,3des-cbc". Protocol version 1 (which is deprecated and not recommended) allows specification of a single cipher. The supported values are "3des", "blowfish", and "des". -CEnables compression of all transmitted data. Compression is desirable on modem lines and other slow connections, but will only slow down response rate on fast networks. -dForce target to be a directory. -F config_fileSpecifies an alternate configuration file to use for this connection. If a configuration file is given on the command line, other configuration files are ignored. -h Displays a summary of command line options. -H schemeSpecifies which SSH configuration scheme to use for this connection. -i key_fileSpecifies a private key to use for key authentication. Key files can also be specified on a per-host basis in the configuration file. It is possible to have multiple -i options (and multiple keys specified in a configuration file). Use quotation marks if the file or path includes spaces. -k directorySpecifies an alternate location for the config, host key, and user key files. Note: When -k is used, host keys are read and written from the specified location only if a known-hosts file already exists in that location. If no known-hosts file is found, host keys are read and written to the known-hosts file in the default location. -m mac_specSpecifies one or more comma-separated MAC (message authentication code) algorithms to use for this connection. Specify algorithms in order of preference. The default is "hmac-sha1,hmac-sha256,hmac-sha512,hmac-md5,hmac-ripemd160,hmac-sha1-96,hmac-md5-96". If the connection is set to run in FIPS mode, the default is "hmac-sha1,hmac-sha256,hmac-sha512". -o optionSets any option that is supported in the configuration file. For example: ssh "-o FIPSMode=yes" myuser@myhost -p Preserve time stamps and file attributes. -P portPort to connect to on the remote host. -qEnables quiet mode, which causes all warning and diagnostic messages, including banners, to be suppressed. -QTurns off display of the progress indicator. -R maximum_requestsSpecifies the maximum number of concurrent requests. Increasing this may slightly improve file transfer speed but will increase memory usage. The default is 16 outstanding requests. -s subsystemSpecifies the ssh subsystem. -S programProgram to use for encrypted connections. -uRemove the source file after copying. -vSets the debug level to verbose mode, which is equivalent to setting the debug level to 2. -VDisplays product name and version information and exits. If other options are specified on the command line, they are ignored. -4Forces connections using IPv4 addresses only. -6Forces connections using IPV6 addresses only. Interactive ModeasciiSet transfer type to ASCII. binarySet transfer type to binary. byeQuit sftp. cd pathChange remote directory to path. chmod pathChanges the permissions associated with path. Use mode to specify a three digit numeric permissions. lcd pathChange local directory to path. exitQuit sftp. get remote-path [local-path]Retrieve the remote-path and store 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. getext [extension,extension...]Displays the file extensions that will use ascii transfer. Use setext to modify this list. helpDisplay help text. lls [ls-options [path]]Display local directory listing of either path or current directory if path is not specified. lmkdir pathCreate local directory specified by path. lpwdPrint local working directory. ls [path]Display remote directory listing of either path or current directory if path is not specified. mkdir pathCreate remote directory specified by path. put local-path [local-path]pwdDisplay remote working directory. quitQuit sftp. reget remote-file [local-file]Resume the specified transfer. This works like the get command, but checks for the presence of a partially written local file and, if it is found, starts the transfer where the last attempt left off. rename oldpath newpathRename remote file from oldpath to newpath. rmdir pathRemove remote directory specified by path. rm pathsDelete remote file specified by path. setext [extension,extension...]Sets the file extensions that will use ascii transfer. Wildcard characters are supported. When no argument is given, no file extensions use ascii transfer. versionDisplay sftp version. ?Synonym for help. | ||
|