Specify an alternate SSH port for scp.
Section: scp Basics
Use scp on a custom port
bash
bash
scp -P 2222 ./file.txt user@example.com:/tmp/Explanation
Specify an alternate SSH port for scp.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing scp Basics