This post originally appeared on the Annexe.

If you want to run scp on a non-standard port, you use the -P flag. So I did this:

scp file.img.xz -P 99999

And what did I get?

ssh: connect to host port 22: no route to host

Why was it ignoring my hypothetically impossible port 99999? Oh, wait.

scp -P 99999 file.img.xz

Coffee hasn’t sunk in yet.