Use scp to copy files over SSH quickly and securely. 29.04.2026 | reading time: 2 min scp is the classic command-line tool to copy files securely over SSH; watch how the admin moves files between local and remote systems with a few concise commands. Real transfer scenario The admin needs to publish a static site and to back up a config file; here are live commands and their typical output examples: ```scp -i ~/.ssh/id_rsa -P 2222 ~/site/index.html alice@server.example.com:/var/www/html/ index.html 100% 3.6KB 10.0KB/s 00:00 scp -r ~/site/ alice@server.example.com:/var/www/html/ file1.html 100% 12KB 20.0KB/s 00:00 assets/img/logo.png 100% 45KB 60.0KB/s 00:00 scp alice@server.example.com:/var/www/html/config.yaml ~/backup/ config.yaml 100% 1.2KB 5.0KB/s 00:00``` Handy switches Use -r for directories, -P to set an alternate SSH port, -i to specify an identity file, -C to enable compression and -p to preserve timestamps and modes; pass any SSH option with -o, and use -3 when copying between two remote hosts through the local machine; be aware that modern OpenSSH's scp prefers SFTP under the hood and the legacy scp protocol has known weaknesses, so choose protocols deliberately. When to pick alternatives For large or repeated synchronizations prefer rsync for delta transfers and resume capability; use sftp for interactive file sessions and sshfs to mount remote filesystems when you need filesystem semantics; scp remains ideal for quick, one-shot transfers and simple scripts. Next steps Try these commands on a safe test host, then practice automating transfers in a script; deepen your Linux skills and consider formal certification — CompTIA Linux+ or LPIC-1 are practical next steps, and bitsandbytes.academy offers intensive exam preparation to get you ready. Join Bits & Bytes Academy First class LINUX exam preparation. network utilities security backup