SCP Files Over A Non-Standard Alternate Port

back to tech articles
scp

I seem to rant often about changing the SSH port. Hmmm.

Today, I want to secure copy (scp) a file to the remote server where SSH accepts incoming connections on a non-standard port (anything other than 22).

Here’s the command:

1
$ scp -P 2222 /source/files.zip jason@8.8.8.8:/destination/directory/

And that is all there is to it.

There’s other ways to achieve this and avoid these alternate commands, such as changing the default SSH port number on your local machine, but where’s the fun in that?

Leave a Reply

Your email address will not be published. Required fields are marked *