SSH

Secure File Transfer with scpg3 and sftpg3 Commands

Using scpg3
Using sftpg3
Enhanced File Transfer Functions

Tectia Client provides commands scpg3 (secure copy) and sftpg3 for secure file transfer. These command-line clients apply the Secure File Transfer Protocol (SFTP).

When files are being uploaded with commands scpg3 and sftpg3, the files have the TRUNCATE flag on. The file size is shown as 0 until the file transfer has been completed.

These secure file transfer commands rely on the Connection Broker to take care of the cryptographic operations and authentication tasks, so they start the Connection Broker (the ssh-broker-g3 process) in run-on-demand mode, if the Connection Broker is not running already.

In case the scpg3 and sftpg3 command-line clients are used in scripts that start several file transfer commands at the same time, the Connection Broker must already be running in the background. Since the Connection Broker takes a few seconds to become up and running, make sure the scripts are not started immediately, because they can fail if the Connection Broker is still starting.

To start the Connection Broker, run the ssh-broker-g3 command. For more information, see ssh-broker-g3(1).

Using scpg3

scpg3 (scpg3.exe on Windows) is used to securely copy files over the network. scpg3 uses ssh-broker-g3 to provide a secure transport using the Secure Shell version 2 protocol. The remote host(s) must be running a Secure Shell version 2 server with the sftp-server (or sft-server-g3) subsystem enabled.

The basic syntax of scpg3 is:

scpg3 user@source:/directory/file user@destination:/directory/file

scpg3 can be used to copy files in either direction; from the local system to the remote system or vice versa. Copies between two remote hosts are also permitted. Local paths can be specified without the user@system: prefix. Relative paths can also be used, they are interpreted in relation to the user's home directory.

Windows paths should be preceded by a slash ("/"). For example, copying a local file to a remote Windows server:

scpg3 localfile user@destination:/C:/directory/file

For more information on the command-line options, see scpg3(1).

Using sftpg3

sftpg3 (sftpg3.exe on Windows) is an FTP-like client that can be used for secure file transfers over the network. sftpg3 uses ssh-broker-g3 to provide a secure transport using the Secure Shell version 2 protocol.

Even though it functions like ftp, sftpg3 does not use any FTP daemon or FTP client for its connections. sftpg3 can be used to connect to any host that is running a Secure Shell version 2 server with the sftp-server (or sft-server-g3) subsystem enabled.

The basic syntax of sftpg3 is:

sftpg3 user@host

sftpg3 has two connection end points, local and remote, and both of them can be connected to other hosts than the Tectia Client host. By default, the local end point is connected to the file system of the Tectia Client host and the remote end point is connected to the host defined on the command line (or left unconnected if no host is defined on the command line).

When started interactively, sftpg3 displays a prompt where the SFTP commands can be entered, much like in the traditional ftp program. It is also possible to start sftpg3 non-interactively with a batch file that contains the commands to be run.

For more information on the command-line options and commands, see sftpg3(1).

Enhanced File Transfer Functions

The following enhanced file transfer features are available with the scpg3 and sftpg3 command-line tools of Tectia Client:

  • Checkpoint/restart for transferring large files (with any IETF-compliant SSH server)

  • Prefix for ensuring that a file is fully transferred before it is used (with any IETF-compliant SSH server)

  • Streaming for improved file transfer speed (with Tectia Servers)

For information on the commands, see scpg3(1) and sftpg3(1).