If you want to copy a file over scp using a different port number than usual, the syntax is:
Assume 1234 is the port number
scp -P 1234 user@remotehost:/folder/file.txt .
And if you want to do the same in rsync over SSH, then the syntax is:
rsync -av --progress -e "ssh -p 1234" user@remotehost:/folder/file.txt .
Note the different capitalisation of the port specifier (“p” is rsync’s ssh connection and “P” in scp).
Be First to Comment