sftpg3 — Secure Shell file transfer client - Generation 3
sftpg3 (sftpg3.exe on Windows) is an
FTP-like client that can be used for file transfer over the network.
sftpg3 launches ssh-broker-g3 to provide a
secure transport using the Secure Shell version 2 protocol.
ssh-broker-g3 will ask for passwords or passphrases if they
are needed for authentication. sftpg3 uses the
configuration specified in the ssh-broker-config.xml
file.
However, it should be noted that sftpg3 is not designed
to be a drop-in replacement for an FTP client. It is an application that
implements secure file transfer functionality and has most features that
common FTP applications have.
To connect to a remote host using sftpg3, the remote
host must be running a Secure Shell version 2 server with the
sftp-server subsystem enabled.
The following options are available:
-B batch_fileUses batch file.
-P portConnects to this Secure Shell port on the remote machine (default: 22).
-b buffer_sizeDefines maximum buffer size for one request (default: 32768 bytes).
-N max_requestsDefines maximum number of requests sent in parallel (default:
10).
--fipsUses the FIPS mode.
--plugin-path=PATHSets plugin path to PATH. This is only used in the FIPS mode.
-V, --versionDisplays version string and exits.
-h, --helpDisplays help and exits.
When sftpg3 is ready to accept commands, it will display
the prompt sftp>. The user can then enter any of the
following commands:
open [ <hostname> | -l ]Tries to connect the remote side to the host <hostname>.
Options:
-lConnects the remote side to the local filesystem (which does not require a server).
lopen [ <hostname> | -l ]Tries to connect the local side to the host
<hostname>. If this is successful,
<lls> and friends will operate on the filesystem on
that host.
Options:
-lConnects the local side to the local filesystem (which does not require a server).
closeCloses the remote connection.
lcloseCloses the local connection.
quitQuits the application.
cd <directory>Changes the current remote working directory.
lcd <directory>Changes the current local working directory.
pwdPrints the name of the current remote working directory.
lpwdPrints the name of the current local working directory.
ls [-R] [-l] [-S] [-r] [-p] [ <file> ... ]Lists the names of files on the remote server. For directories, contents are listed. If no arguments are given, the contents of current working directory are listed.
Options:
-RDirectory trees are listed recursively. By default, subdirectories of the arguments are not visited.
-lPermissions, owners, sizes and modification times are also shown (long format).
-SSorting is done based on file sizes (default: alphabetically).
-rThe sort order is reversed.
-pOnly one page of listing is shown at one time.
lls [-R] [-l] [-S] [-r] [-p] [ <file> ... ]Same as ls, but operates on the local files.
get [-p] [--preserve-attributes]
[-u] [--unlink-source]
[-I] [--interactive]
[--overwrite]
[--checksum]
[-W] [--whole-file]
[--checkpoint]
[--streaming]
[--force-lower-case]
[--prefix=PREFIX]
[ <file> ... ]
Transfers the specified files from the remote end to the local end. Directories are recursively copied with their contents.
Options:
-p, --preserve-attributesTries to retain permissions and timestamps.
-u, --unlink-sourceRemoves the source file after file transfer. Also directories are removed, if they become empty (move mode).
-I, --interactivePrompts whether to overwrite an existing destination file (does not work with batch mode).
--overwrite[=yes|no]Decides whether to overwrite existing destination file(s) (default:
yes).
--checksum[=yes|no|md5|sha1|md5-force|sha1-force|checkpoint]Uses MD5 or SHA-1 checksums or a separate checkpoint database to
determine the point in the file where file transfer can be resumed. Files
smaller than buffer_size are not checked. Use
md5-force or sha1-force with small files (default:
yes, i.e. use MD5 checksums).
-W, --whole-fileDoes not try incremental checks (default: no, i.e. try
incremental checks).
--checkpoint=s<seconds>Time interval between checkpoint updates (default: 10 seconds).
--streaming[=yes|no|force]Uses streaming in file transfer, if server supports it. Files
smaller than buffer_size are not transferred using streaming.
Use force with small files (default: yes).
--checkpoint=b<bytes>Byte interval between checkpoint updates (default: 10 MB).
--force-lower-caseDestination filename will be converted to lowercase characters.
--prefix=PREFIXAdds prefix PREFIX to filename during the file
transfer. The prefix is removed after the file has been successfully
transferred.
mget [options] [ <file> ... ]Synonymous to get.
put [options] [ <file> ... ]Transfers the specified files from the local end to the remote end. Directories are recursively copied with their contents.
Options are the same as for get.
mput [options][ <file> ... ]Synonymous to put.
rm [-I] [--interactive] [ <file> ... ]Tries to delete file or directory specified in <file>.
Directories are removed recursively.
Options:
-I, --interactivePrompts whether to remove a file or directory (does not work with batch mode).
lrm [options] [ <file> ... ]Same as rm, but operates on the local files.
mkdir <directory>Tries to create the directory specified in <directory>.
lmkdir <directory>Same as mkdir, but operates on the local files.
rmdir <directory>Tries to delete the directory specified in <directory>.
lrmdir <directory>Same as rmdir, but operates on the local files.
rename <oldfile> <newfile>Tries to rename the <oldfile> to
<newfile>. If <newfile> already
exists, the files are left intact.
lrename <oldfile> <newfile>Same as rename, but operates on the local files.
readlink <path>Provided that <path> is a symbolic link, shows where the link
is pointing to.
lreadlink <path>Same as readlink, but operates on the local files.
symlink <targetpath> <linkpath>Creates symbolic link <linkpath>, which will point to
<targetpath>.
lsymlink <targetpath> <linkpath>Same as symlink, but operates on the local files.
ascii [-s] [<remote_nl_conv>] [<local_nl_conv>]Sets transfer mode to ASCII. <remote_nl_conv>
sets a remote newline convention. <local_nl_conv>
operates on the local side, but is not as useful (the correct local
newline convention is usually compiled in, so this is mainly for testing).
Please note that these are only hints for the underlying transfer layer,
which tries to use the newline convention given by the server wherever
possible. You can set either of these to ask, which will
cause sftp to prompt you for the newline convention when
needed. Available conventions are dos, unix or
mac, using \r\n, \n and
\r as newlines, respectively.
Options:
-sOnly shows current newline convention. Does not set transfer mode to ASCII.
binaryFiles will be transfered in binary mode.
autoFile transfer mode will be selected automatically from the file extension.
setext [ <extension> ... ]Sets the file extensions that will be ASCII in the auto transfer mode. Normal zsh-fileglob regexps can be used in the file extensions.
getextDisplays the extensions that will be ASCII in the auto transfer mode.
lsrootsDumps the virtual roots of the server. (This is a VShell extension. Without this you cannot know the filesystem structure of a VShell server.)
chmod [-R] [-f] [-v] OCTAL-MODE [<file> ...], chmod [-R] [-f] [-v] [ugoa][+-=][rwxs] [<file> ...]Sets file permissions of the specified file or files to the bit
pattern OCTAL-MODE or changes permissions according to the
symbolic mode [ugoa][+-=][rwxs]. Only one symbolic mode
combination is supported.
Options:
-RRecursively changes files and directories.
-fUses silent mode (error messages are suppressed).
-vUses verbose mode (lists every file processed).
lchmod [-R] [-f] [-v] OCTAL-MODE [<file> ...], lchmod [-R] [-f] [-v] [ugoa][+-=][rwxs] [<file> ...]Same as chmod, but operates on local files.
digest [-H] [--hash] [-o] [--offset] [-l] [--length] <file>Calculates MD5 or SHA-1 digest over file data.
Options:
-H, --hash=[md5|sha1]Use md5 or sha1 hash alorithm (default:
md5).
-o, --offset=OFFSETStart reading from file offset OFFSET.
-l, --length=LENGTHRead LENGTH bytes of file data.
ldigest [-H] [--hash] [-o] [--offset] [-l] [--length] <file>Same as digest, but operates on local files.
setperm <fileperm[:dirperm]>Sets the default file or directory permission bits for upload.
(Prefix fileperm with p to preserve permissions
of existing files or directories.)
help [ <topic> ]If <topic> is not given, lists the available
topics. If <topic> is given, outputs available online
help about the topic.
helpallOutputs available online help about all topics.
sftpg3 understands both backslashes
(\) and quotation marks (") on the command
line. A backslash can be used for ignoring the special meaning of any
character in the command-line interpretation. It will be removed even if
the character it precedes has no special meaning.
Quotation marks can be used for specifying filenames with spaces.
Also, if you do 'get .' or 'put .' you
will get or put every file in the current directory and possibly override
files in your current directory.
sftpg3 supports wild cards (also known as glob
patterns) given to commands chmod, lchmod,
ls, lls, rm, lrm,
get, and put.
On Unix, the following key sequences can be used for command-line editing:
Set mark.
Go to the beginning of the line.
Move the cursor one character to the left.
Erase the character to the right of the cursor, or exit the program if the command line is empty.
Go to the end of the line.
Move the cursor one character to the right.
Backspace.
Tab.
Enter.
Delete the rest of the line.
Redraw the line.
Enter.
Move to the next line.
Move to the previous line.
Toggle two characters.
Delete the line.
Delete a region (the region's other end is marked with Ctrl-Space).
Begin an extended command.
Yank deleted line.
Undo.
Lower case region.
Upper case region.
Exchange cursor and mark.
Mark the whole buffer.
Undo.
Backwards word delete.
Backwards word delete.
Delete extra spaces (leaves only one space).
Go to the beginning of the line.
Go to the end of the line.
Mark current word.
Go back one sentence.
Go back one word.
Capitalize current word.
Delete current word.
Go forward one sentence.
Go forward one word.
Delete current sentence.
Change current word to lower case.
Transpose words.
Change current word to upper case.
Backspace.