🌐 Linux Free Masterclass (Episode 22): Secure File Transfer (scp)
How do you securely upload scripts and configurations to a remote server or download logs back to your local machine over the network without relying on external cloud drives or USB sticks? Through scp (Secure Copy Protocol).
Here are the key points from Episode 22:
🔹 1. What is SCP?
Definition: Secure Copy Protocol transfers files between local and remote systems over an encrypted SSH channel.
Core Purpose: Ensures data confidentiality and integrity during network file transfers directly from the terminal.
🔹 2. Uploading and Downloading Files (scp)
Local to Remote (Upload): Send a local file to a target directory on a remote host:
scp report.txt username@server_ip:/path/to/destination/
Remote to Local (Download): Pull a file from a remote server into your current local directory (denoted by .):
scp username@server_ip:/path/to/remote/file.txt .
🔹 3. Copying Entire Directories (-r Flag)
Recursive Transfer: To transfer an entire folder along with all nested files and subdirectories, include the -r flag:
scp -r my_folder root@192.168.1.50:/var/www/
🚀 Think of scp like an encrypted digital courier service running directly between machines: instead of manually uploading to third-party storage or physically carrying drives, your files travel safely over an encrypted tunnel straight to their destination!

Top comments (0)