Last updated:

SSH – Transferring Files

Table of Contents

SFTP

SFTP transfers files over SSH while emulating the interface of many command-line FTP programs. Assuming the appropriate binaries are in your path, you can run SFTP like this:

Running PSFTP on Windows

Running PSFTP from your local computer:

  1. Input C:\>psftp -P 52222 username@ssh.ouac.on.ca and press “Enter”.
  2. Use “username”
  3. username@ssh.ouac.on.ca’s password: password and press “Enter”.
  4. Remote working directory is home-directory psftp>
Running SFTP on Unix

Running SFTP on Unix from your local computer:

  1. Input $ sftp -oPort=52222 username@ssh.ouac.on.ca and press “Enter”.
  2. Connect to ssh.ouac.on.ca.
  3. username@ssh.ouac.on.ca’s password: password and press “Enter”.
  4. sftp>

You can now transfer files using put, get, mput and mget like you would in most command-line FTP clients.

SCP

The SCP command can be used to transfer a single file over SSH.

You will be prompted to enter your password for each transfer, so it is not the most user-friendly way to move multiple files interactively. However, when used with public key authentication, SCP is well suited to scripting.

Running pscp on Windows

To copy a local file from your computer to the server:

  1. Input C:\>pscp -P 52222 local-file username@ssh.ouac.on.ca:remote-file and press “Enter”.
  2. Input username@ssh.ouac.on.ca’s password: password and press “Enter”.
  3. You should see this information: file | 2 kB | 2.7 kB/s | ETA: 00:00:00 | 100%

To copy a remote file from your computer to the local computer:

  1. Input C:\>pscp -P 52222 username@ssh.ouac.on.ca:remote-file local-file and press “Enter”.
  2. Input username@ssh.ouac.on.ca’s password: password and press “Enter”.
  3. You should see this information: file | 2 kB | 2.7 kB/s | ETA: 00:00:00 | 100%
Running scp on Unix

To copy a local file from your computer to the server:

  1. Input $ scp -oPort=52222 local-file username@ssh.ouac.on.ca:remote-file and press “Enter”.
  2. Input chris@ssh.ouac.on.ca’s password: password and press “Enter”.
  3. You should see this information: file 100% 963 9.9MB/s 00:00

To copy a remote file from your computer to the local computer:

  1. Input $ scp -oPort=52222 username@ssh.ouac.on.ca:remote-file local-file and press “Enter”.
  2. Input chris@ssh.ouac.on.ca’s password: password and press “Enter”.
  3. You should see this information: file 100% 963 9.9MB/s 00:00

Related link:

Back to top