System Administration Guide: Security Services

ProcedureHow to Copy Files With Solaris Secure Shell

The following procedure shows how to use the scp command to copy encrypted files between hosts. You can copy encrypted files either between a local host and a remote host, or between two remote hosts. The command operates similarly to the rcp command, except that the scp command prompts for authentication. For more information, see the scp(1) man page.

You can also use the sftp, a more secure form of the ftp command. For more information, see the sftp(1) man page. For an example, see Example 19–6.

  1. Start the secure copy program.

    Specify the source file, the user name at the remote destination, and the destination directory.

    myLocalHost% scp myfile.1 jdoe@myRemoteHost:~
  2. Supply your passphrase when prompted.

    Enter passphrase for key '/home/jdoe/.ssh/id_rsa': <Type passphrase>
    myfile.1       25% |*******                      |    640 KB  0:20 ETA 

    After you type the passphrase, a progress meter is displayed. See the second line in the preceding output. The progress meter displays:

    • The file name

    • The percentage of the file that has been transferred

    • A series of asterisks that indicate the percentage of the file that has been transferred

    • The quantity of data transferred

    • The estimated time of arrival, or ETA, of the complete file (that is, the remaining amount of time)

Example 19–6 Specifying a Port When Using the sftp Command

In this example, the user wants the sftp command to use a specific port. The user uses the -o option to specify the port.

% sftp -o port=2222 guest@RemoteFileServer