Managing Remote Systems in Oracle® Solaris 11.2

Exit Print View

Updated: July 2014
 
 

How to Copy Files to a Remote System (sftp)

  1. Change to the source directory on the local system.

    The directory from which you type the sftp command is the local working directory and thus the source directory for this operation.

  2. Establish an sftp connection.

    See How to Open and Close an sftp Connection to a Remote System.

  3. You can change to the target directory.
    sftp> cd target-directory
  4. Ensure that you have write permission in the target directory.
    sftp> ls -l target-directory
  5. To copy a single file, use the put command.

    Metacharacters may be used with the get command.

    sftp> put filename
  6. Close the sftp connection.
    sftp> bye
Example 3-4  Copying a File to a Remote System (sftp)

In this example, the user opens an sftp connection to the system pluto, and uses the put command to copy a file from their system to the /tmp directory on system pluto.

$ cd /tmp
$ sftp pluto
Password: xxx
sftp> cd /tmp
sftp> put filef
uploading filef to /tmp/filef
filef                                     100%  325     0.3KB/s   00:00
sftp> ls
filea
filef
files
sftp> bye