2024-09-09 web, development, javascript

How to Use SCP to Copy Files to a Remote Server

By O. Wolfson

SCP is a shell command used to copy files to, or from, a remote server via the command line interface. It is based on the ssh protocol. You’ll need the username and ip address of the remote server, and the password for that user at the remote server. At the command line prompt, type the following command, substituting “file” with the path to the file that you want to copy. After a space, type the username and ip address of the remote server and the path to the remote directory that you want to copy into.

Secure Copy

bash
scp file username@ipaddress:/remote/dir

After you press enter you should be prompted to enter the password. Note that in most terminals the password will not register any feedback or move the cursor, it will remain blank. Just press enter.

Example

bash
scp /home/text_files/001_content.txt billy@192.185.00.222:/home/billy/public_html/textfiles