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:
$ scp -P 2222 /source/files.zip email@example.com:/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?