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:
- Input C:\>psftp -P 52222 username@ssh.ouac.on.ca and press “Enter”.
- Use “username”
- username@ssh.ouac.on.ca’s password: password and press “Enter”.
- Remote working directory is home-directory psftp>
Running SFTP on Unix
Running SFTP on Unix from your local computer:
- Input $ sftp -oPort=52222 username@ssh.ouac.on.ca and press “Enter”.
- Connect to ssh.ouac.on.ca.
- username@ssh.ouac.on.ca’s password: password and press “Enter”.
- 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:
- Input C:\>pscp -P 52222 local-file username@ssh.ouac.on.ca:remote-file and press “Enter”.
- Input username@ssh.ouac.on.ca’s password: password and press “Enter”.
- 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:
- Input C:\>pscp -P 52222 username@ssh.ouac.on.ca:remote-file local-file and press “Enter”.
- Input username@ssh.ouac.on.ca’s password: password and press “Enter”.
- 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:
- Input $ scp -oPort=52222 local-file username@ssh.ouac.on.ca:remote-file and press “Enter”.
- Input chris@ssh.ouac.on.ca’s password: password and press “Enter”.
- 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:
- Input $ scp -oPort=52222 username@ssh.ouac.on.ca:remote-file local-file and press “Enter”.
- Input chris@ssh.ouac.on.ca’s password: password and press “Enter”.
- You should see this information: file 100% 963 9.9MB/s 00:00
Related link: