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 scp command prompts for authentication. For more information, see Remote Copying With the scp Command in Managing Remote Systems in Oracle Solaris 11.3 and the scp(1) man page.
You can also use the sftp secure file transfer program. For more information, see the sftp (1) man page. For an example, see Example 7, Specifying a Port When Using the sftp Command and Logging In to a Remote System to Copy a File (sftp) in Managing Remote Systems in Oracle Solaris 11.3.
Specify the source file, the user name at the remote destination, and the destination directory.
mySystem$ scp myfile.1 username@myRemoteSys:~
Enter passphrase for key '/home/username/.ssh/id_rsa': passphrase myfile.1 25% |******* | 640 KB 0:20 ETA myfile.1
After you type the passphrase, a progress meter is displayed, as shown in the second line in the 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)
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