This article describes how to use SCP (Secure Copy Protocol) to transfer files quickly and securely from the command line.
Secure Copy (SCP) is a protocol based on SSH (Secure Shell) that provides secure file transfers between two computers. With SCP, you can quickly transfer files using the command line, which is often faster and easier than using a client with a graphical interface. Additionally, you can use this command-line functionality in your own batch files and scripts to automate file transfers.
Follow the appropriate procedure below for your computer's operating system to use SCP.
Microsoft Windows does not include an SCP client, so you must download one first. A2 Hosting recommends PSCP, a free program that you can download here.
After you have downloaded the PSCP executable to your local computer, you should add the directory where pscp.exe is located to your path so you can run it from any directory. After you do this, you are ready to transfer files to and from your A2 Hosting account. To do this, follow these steps:
pscp -P 7822 file username@example.com:/home/username/destination
To download a file from your A2 Hosting account, type the following command. Replace both occurrences of username with your A2 Hosting username, and example.com with your site's domain name. Additionally, replace file with the name of the file on your A2 Hosting account that you want to download, and replace destination with the destination directory on your local computer:
pscp -P 7822 username@example.com:/home/username/file destination
Type your password when you are prompted to do so. PSCP downloads the file to the destination directory that you specified.
There are a few additional options that you may find useful when working with PSCP:
pscp -r -P 7822 [email protected]:/home/username/public_html .
Both Mac OS X and Linux include the scp client program, so you do not have to download a special client. To use the scp program, follow these steps:
To upload a file to your A2 Hosting account, type the following command. Replace username with your A2 Hosting username, and example.com with your site's domain name. Additionally, replace file with the name of the file on your local computer that you want to upload, and replace destination with the destination directory on your A2 Hosting account:
scp -P 7822 file username@example.com:~/destination
To download a file from your A2 Hosting account, type the following command. Replace username with your A2 Hosting username, and example.com with your site's domain name. Additionally, replace file with the name of the file on your A2 Hosting account that you want to download, and replace destination with the destination directory on your local computer:
scp -P 7822 username@example.com:~/file destination
Type your password when you are prompted to do so. Scp downloads the file to the destination directory that you specified.
There are a few additional options that you may find useful when working with scp:
scp -rP 7822 [email protected]:~/public_html .
For more information about SCP, please visit http://en.wikipedia.org/wiki/Secure_copy.
Subscribe to receive weekly cutting edge tips, strategies, and news you need to grow your web business.
No charge. Unsubscribe anytime.
Did you find this article helpful? Then you'll love our support. Experience the A2 Hosting difference today and get a pre-secured, pre-optimized website. Check out our web hosting plans today.
We use cookies to personalize the website for you and to analyze the use of our website. You consent to this by clicking on "I consent" or by continuing your use of this website. Further information about cookies can be found in our Privacy Policy.