scpg3 — Secure Shell file copy client - Generation 3
scpg3
[options
...]
[[user@
] src_host
[#port
]:]src_file
...
[[user@
] dst_host
[#port
]:]dst_file_or_dir
scpg3
(scpg3.exe
on Windows) is used to
securely copy files over the network. scpg3
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. scpg3
uses the configuration
specified in the ssh-broker-config.xml
file.
Any filename may contain a host, user, and port specification to
indicate that the file is to be copied to or from that host. Copies
between two remote hosts are permitted. The remote host(s) must be
running a Secure Shell version 2 server with the sftp-server
subsystem enabled.
The host
parameter can optionally be
enclosed in square brackets ([]
) to allow the use of
semicolons. The
file
argument can contain simple wild cards:
asterisk (*
) for any number of characters and question mark
(?
) for any one character.
The following command-line parameters can be used to further specify
the scpg3
options.
-a[arg]
Transfers files using the ASCII mode, that is, newlines will be
converted on the fly. See the ascii
command
in the section called “Commands”.
If the server does not advertise the newline convention, you can give
it a hint by giving an argument after -a
. The default is to
set the destination newline convention, but you can specify either one by
prefixing the argument with src:
or dest:
for source or destination convention, respectively. The available
conventions are dos
, unix
, and mac
,
using \r\n
, \n
, and \r
as newlines,
respectively. An example is shown below:
$ scpg3 -asrc:unix -adest:dos src_host:src_file dest_host:dest_file
-b
buffer_size
Defines maximum buffer size for one request (default: 32768
bytes).
-B, --batch-mode
Uses batch mode.
-d
Forces target to be a directory.
-D, --debug=
LEVEL
Sets the debug level. LEVEL
is a number
from 0 to 99, where 99 specifies that all debug information should be
displayed. This should be the first argument on the command line.
-I, --interactive
Prompts whether to overwrite an existing destination file (does not
work with -B
).
-N
max_requests
Defines maximum number of requests sent in parallel (default:
10
).
-O, --offset=r<offset>|w<offset>|l<length>|t<length>
Sets offset. Offset r<offset>
specifies the start
offset in the source file. Offset w<offset>
specifies
the start offset in the destination file. Length
l<length>
specifies the amount of data to be copied.
Truncate length t<length>
, if given, specifies the
length to which the destination file is truncated or expanded after the
file data has been copied.
-p
Preserves file attributes (Unix) and timestamps (Unix and Windows).
-P
port
Connects to this Secure Shell port on the remote machine (default: 22
).
-q
Uses quiet mode (only fatal errors are shown).
-Q
Does not show progress indicator.
-r
Recurses subdirectories.
-u, --unlink-source
Removes source files after copying (file move).
-v, --verbose
Uses verbose mode (equal to -D 2
).
--fips
Uses the FIPS mode.
--force-lower-case
Destination filename will be converted to lowercase characters.
--overwrite
[={yes|no}
]Decides whether to overwrite existing destination file(s) (default:
yes
).
--password=
PASSWORD
|file://
PASSWORDFILE
|extprog://
PROGRAM
Sets user password that the client will send as a response to password
authentication. The PASSWORD
can be given
directly as an argument to this option (not recommended), or a path to file
containing the password can be given, or a path to a program or a script
that outputs the password can be given.
Caution | |
---|---|
Supplying the password on the command line is not a secure option. For example, in a multi-user environment, the password given directly on the command line is trivial to recover from the process table. You should set up a more secure way to authenticate. For non-interactive batch jobs, it is more secure to use public-key authentication without a passphrase, or host-based authentication. At a minimum, use a file or a program to supply the password. |
--plugin-path=
PATH
Sets plugin path to PATH
. This is only used in the FIPS mode.
--prefix=
PREFIX
Adds prefix to filename during the file transfer. The prefix is removed after the file has been successfully transferred.
--statistics[=yes|no|simple]
Chooses the statistics style (default: yes
).
--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
).
--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-file
Does not try incremental checks (default: no
, i.e. try
incremental checks).
--checkpoint=s<seconds>
Time interval between checkpoint updates (default: 10 seconds).
--checkpoint=b<bytes>
Byte interval between checkpoint updates (default: 10 MB).
-V, --version
Displays program version and exits.
-?, -h, --help
Displays a short summary of command-line options and exits.
scpg3
returns the following values based on the
success of the operation:
0 Operation was successful. 1 Internal error. 2 Connection aborted by the user. 3 Destination is not a directory, but a directory was specified by the user. 4 Connecting to the host failed. 5 Connection lost. 6 File does not exist. 7 No permission to access file. 8 Undetermined error from sshfilexfer. 101 Wrong command-line arguments specified by the user.
Copy files from your local system to a remote Unix system:
$ scpg3 localfile user@remotehost:/dest/dir/for/file/
Copy files from your local system to a remote Windows system:
$ scpg3 localfile user@remotehost:/C:/dest/dir/for/file/
Copy files from a remote system to your local disk:
$ scpg3 user@remotehost:/dir/for/file/remotefile /dest/dir/for/file