Using SCP to copy a file on a non standard ssh port

Frequently system administrators will change the SSH port from the standard port 22 for security reasons. If this is the case and you need to transfer something via SCP, below is the command to transfer a file from one server to another using a non standard SSH port.


Transfer a file with SCP on port 3838

As you can see above we are using port 3838 instead of 22.

Transfer entire directory with SCP on port 3838

If you want to move an entire folder you have to use the r attribute:

This will create a copy of “directory” under the “folder” directory from the example above.

Myles

Orlando, FL

Did this post help you?

Give back and rate it for me!

Related Posts

  • keshav gaur

    What if the target machine requries port?

  • Brett Pick

    Thank you!