While **SCP** counts in **Kilobyte/sec** (**KB/s**). So if you want to limit your bandwidth for **SCP** maximum only **50 KB/s**, you need to set it into **50 x 8 = 400**.
Usually **SCP** is using port **22** as a default port. But for security reason, you may change the port into another port. For example, we are using port **2249**. Then the command should be like this.
Make sure that it use capital “**P**” not “**p**“, since “**p**” is already used for preserved times and modes.
### Copy files inside directory recursively ###
Sometimes we need to copy directory and all **files** / **directories** inside it. It will be better if we can do it in **1** command. **SCP** support that scenario using “**-r**” parameter.
When the copy process is done, at the destination server you will found a directory named “**documents**” with all it’s files. The folder “**documents**” is automatically created.
### Disable progress meter and warning / diagnostic message ###
If you choose not to see progress meter and warning / diagnostic messages from SCP, you may disable it using “**-q**” parameter. Here’s the example.
As you can see, after the you enter the password, there is no any information about SCP process. After the process is complete, you will be see a prompt again.
### Copy files using SCP through Proxy ###
Proxy server is usually used in office environment. Natively, SCP is not proxy configured. When your environment using proxy, you have to “tell” SCP to communicate with the proxy.
Here’s the scenario. The proxy address is **10.0.96.6** and the proxy port is **8080**. The proxy also implemented user authentication. First, you need to create “**~/.ssh/config**” file. Second you put this command inside it.
Then you need to create file “**~/.ssh/proxyauth**” which contain.
myusername:mypassword
After that you can do SCP transparently as usual.
Please notice that corkscrew is might not installed yet on your system. On my Linux Mint, I need to install it first, using standard Linux Mint installation procedure.
$ apt-get install corkscrew
For other yum based systems, users can install corkscrew using the following yum command.
# yum install corkscrew
Another thing that since “**~/.ssh/proxyauth**” file contain your “**username**” and “**password**” in clear-text format, please make sure that the file can be accessed by you only.
### Select different ssh_config file ###
For mobile user who often switch between company network and public network, it will be suffer to always change settings in SCP. It is better if we can put a different **ssh_config** file to match our needs.
#### Here’s a sample scenario ####
Proxy is used in company network but not in public network and you are regularly switch network.
By default “**ssh_config**” file per user will be placed in “**~/.ssh/config**“. Creating a specific “**ssh_config**” file with proxy compatible, will make you easier to switch between networks.
When you are on company network, you can use “**-F**” parameter. When you are on public network, you can skip “**-F**” parameter.
That’s all about **SCP**. You can see **man pages** of **SCP** for more detail. Please feel free to leave comments and suggestions.