-
-
Notifications
You must be signed in to change notification settings - Fork 2
Linux scp Guide
Mattscreative edited this page Dec 5, 2025
·
2 revisions
Complete beginner-friendly guide to scp on Linux, covering Arch Linux, CachyOS, and other distributions including secure file copying, remote file transfer, and SSH-based file operations.
Basic usage:
# Copy file to server
scp file.txt user@server:/path/to/destination
# Copies file to remote serverDownload file:
# Copy file from server
scp user@server:/path/to/file.txt .
# Downloads file to current directoryNon-standard port:
# Custom SSH port
scp -P 2222 file.txt user@server:/path/
# -P = port (capital P for scp)Keep permissions:
# Preserve permissions
scp -p file.txt user@server:/path/
# -p = preserve (keeps permissions and timestamps)Copy directory:
# Copy directory recursively
scp -r directory/ user@server:/path/
# -r = recursive (copies directory)Show progress:
# Verbose output
scp -v file.txt user@server:/path/
# -v = verbose (shows progress)Compress during transfer:
# Compress during transfer
scp -C file.txt user@server:/path/
# -C = compression (faster on slow connections)Use specific key:
# Use specific SSH key
scp -i ~/.ssh/id_ed25519 file.txt user@server:/path/
# -i = identity (SSH key file)Check SSH access:
# Test SSH connection first
ssh user@server
# Ensure SSH works before using scpCheck network:
# Test connectivity
ping server
# Verify server is reachableThis guide covered scp usage, secure file copying, and remote file transfer for Arch Linux, CachyOS, and other distributions.
- rsync Guide - Advanced file synchronization
- SSH Configuration - SSH setup
- ssh-keygen Guide - SSH keys
-
scp Documentation:
man scp
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.