- Published on
SCP
- Authors
- Name
- PatharaNor
![]()
Simple Usage
Not checking host key :
scp -o StrictHostKeyChecking=no -rp ./* username@hostname:/path/to/destination
Normally
To copy all from Local Location to Remote Location (Upload) :
scp -r /path/from/destination username@hostname:/path/to/destination
To copy all from Remote Location to Local Location (Download) :
scp -r username@hostname:/path/from/destination /path/to/destination
Custom Port where xxxx is custom port number :
scp -r -P xxxx username@hostname:/path/from/destination /path/to/destination
Copy on current directory from Remote to Local :
scp -r username@hostname:/path/from/file .
Help
-rRecursively copy all directories and files.- Always use full location from
/, Get full location bypwd. scpwill replace all existing files.- Host name will be
hostnameorIP address. - if custom port is needed (besides port
22) use-Pportnumber. .(dot) - it means current working directory, So download/copy from server and paste here only.
⚠️ Caution
Sometimes the custom port will not work due to the port not being allowed in the firewall, so make sure that custom port is allowed in the firewall for incoming and outgoing connection.