Secure copy files from one server to another (including port number)

Posted 3 years ago

This is whilst you’re on the server waiting to receive the file

scp -P 2020 username@address:/file/to/send/old/location/ /where/to/save/new/location

Note: it uses a uppercase ‘P’

scp username@address:/file/to/send/old/location/ /where/to/save/new/location

If you’re on the server in and you’re sending the file somewhere else, flip it around

scp /file/to/send/old/location/ username@address:/where/to/save/new/location