SCP is the file copy that rides inside SSH. With it, a router can send or receive a configuration backup or an IOS image with the user authenticated and the data encrypted. On Cisco IOS it is one copy command once the server side is on, and almost every failure comes from the SSH prerequisites underneath it or from an error message that points at the wrong problem. The worst one claims a file does not exist when the real cause is a server that’s switched off.
This guide turns on the SCP server on one router, pulls and pushes a file from a second router, checks the copy with an MD5 hash, and then breaks it to show the errors you will actually see. It also covers where SFTP fits, since it’s the other secure transfer Cisco devices use. Everything in the lab ran in November 2026 on Cisco 7200 routers with IOS 15.2(4)S3 in GNS3, with SSH version 2 only and no TFTP or FTP server anywhere on the network.
What SCP needs on a Cisco router
SCP has no service of its own. It runs over the router’s SSH server and uses AAA to decide who may copy, so we put five things in place on the server side before the first copy.
- A hostname and
ip domain name, which name the RSA keys - An RSA key pair, which turns the SSH server on
- A local user at privilege level 15
aaa new-modelwith login authentication and exec authorizationip scp server enable
The router that starts the copy is the SCP client and needs none of that server setup, only a route to the server and an account on it. Keep the roles straight, because most “SCP does not work” tickets turn out to be the server command on the wrong router.
The SCP lab
Two routers share a /30 on Gi0/0, R1 at 10.0.12.1 and R2 at 10.0.12.2 (mask 255.255.255.252). R1 is the SCP server and R2 is the client that pulls a file from it and pushes one back.

One GNS3 detail matters if you rebuild this lab. The emulated 7200 has no writable flash by default, and nvram: refuses anything but its own configuration files, so we set a disk0: size in the GNS3 node settings. IOS then reported a small 62 KB disk, enough for configuration files but not for an image. On real hardware or IOS XE, use flash: or bootflash: wherever this guide says disk0:.

Turn on the SCP server on R1
Start with the hostname, the domain name, the account, AAA and SSH access on the VTY lines. Do this from the console: transport input ssh shuts Telnet out of the VTY lines before the RSA keys exist, so a Telnet session that drops in between leaves you with no remote access. The password here is a lab value, so use your own.
hostname R1
ip domain name lab.example
username admin privilege 15 secret LabPass123
aaa new-model
aaa authentication login default local
aaa authorization exec default local
line vty 0 4
transport input ssh
login authentication default
Generate the keys, force SSH version 2 and switch on the SCP server.
crypto key generate rsa modulus 2048
ip ssh version 2
ip scp server enable
IOS names the key pair after the hostname and domain and confirms the size. Then check that SSH is up.
show ip ssh | include SSH
Enabled and version 2.0 is what you want before going further.
SSH Enabled - version 2.0
To have something to copy, R1 saved its running configuration to disk0:, and we hashed it so the copy can be checked later.
copy running-config disk0:r1-backup.cfg
verify /md5 disk0:r1-backup.cfg
The file is 1,358 bytes, and its MD5 digest is the value we compare against on R2.
Destination filename [r1-backup.cfg]?
1358 bytes copied in 0.892 secs (1522 bytes/sec)
.Done!
verify /md5 (disk0:r1-backup.cfg) = 4a4c9db857e913607e6cba12e51ee66d
Pull a file to R2 with copy scp
The copy command takes the source first and the destination second, so an scp: URL in the first position pulls a file. The URL carries the account, the server and the path on the server. Give R2 a hostname, a domain name and its own RSA keys first, as we did in the lab. Without the domain name, key generation is refused:
hostname R2
ip domain name lab.example
crypto key generate rsa modulus 2048
Then run the copy from R2.
copy scp://[email protected]/disk0:r1-backup.cfg disk0:r1-backup.cfg
IOS asks for the destination name and the password, and prints a ! for each block it moves.
Destination filename [r1-backup.cfg]?
Password:
!
1358 bytes copied in 2.932 secs (463 bytes/sec)
Check the copy against the original before you trust it, which matters far more for a 500 MB IOS image than for a config file.
verify /md5 disk0:r1-backup.cfg
The digest on R2 matches R1’s exactly, so the file arrived intact.
verify /md5 (disk0:r1-backup.cfg) = 4a4c9db857e913607e6cba12e51ee66d

For a real image, give verify /md5 the digest from Cisco’s download page as an argument and IOS will compare the two for you. Do it before you point the boot variable at the new file, because a corrupted image only shows itself when the router fails to boot, and by then you are working from ROMMON.
Push a file back to R1
Swap the order and the same command uploads. With a local file first and the scp: URL second, R2 pushes its copy to R1 under a new name.
copy disk0:r1-backup.cfg scp://[email protected]/disk0:r2-copy.cfg
IOS confirms the host, user and file name it parsed from the URL, then asks for the password.
Address or name of remote host [10.0.12.1]?
Destination username [admin]?
Destination filename [disk0:r2-copy.cfg]?
Writing disk0:r2-copy.cfg
Password:
!
1358 bytes copied in 0.864 secs (1572 bytes/sec)
dir disk0: on R1 now lists both files, the original and r2-copy.cfg. Pushing to a Linux backup server running OpenSSH is the more common production job, with the router as the client and a normal SSH account on the server, and the path in the URL is then resolved on the Linux side. We did not test that leg here, and an old IOS SSH client can fail to agree on key and host-key algorithms with a current OpenSSH server, so check the algorithm settings on both ends if the session closes before the password prompt.
Read the SCP error messages
Two of the three errors below point somewhere other than the real cause, which is why they cost people time.
% Authentication failed … (Permission denied)
A wrong password gets two prompts and then this pair of lines on the client.
Password:
Password:
% Authentication failed.
%Error opening scp://*****@10.0.12.1/disk0:r1-backup.cfg (Permission denied)
This one is honest. Check the username in the URL and the password, and on the server check that the account exists locally (or on the AAA server) at privilege level 15, which Cisco requires for SCP on both IOS and IOS XE.
(No such file or directory) when the file is there
We turned the server off on R1 with no ip scp server enable and repeated a copy that had just worked.
Destination filename [y.cfg]?
Password:
%Error opening scp://*****@10.0.12.1/disk0:r1-backup.cfg (No such file or directory)
The file is still on R1, and the password was accepted, so SSH itself works. What is missing is the SCP server, yet the client reports a missing file. When an SCP copy says “No such file or directory” for a file you can see in dir on the server, check show running-config | include scp there before anything else.
SSH Disabled: Please create RSA keys
Configuring ip ssh version 2 before the keys exist gives a warning, and show ip ssh reports SSH as disabled.
SSH Disabled - version 2.0
%Please create RSA keys to enable SSH (and of atleast 768 bits for SSH v2).
Without keys there’s no SSH server and so no SCP. A client then sees % Connection refused by remote host. Generate the key pair, which also needs the domain name set first, and SSH comes up on its own.
Where SFTP fits
SFTP also runs over SSH, but Cisco devices support it unevenly, so check your platform before you plan around it. On the Catalyst 9300 with IOS XE, Cisco documents the SFTP client as built into SSH and always on, with no SFTP server: the switch can push and pull files with copy ... sftp://, but a backup server cannot open an SFTP session to the switch, and SCP against ip scp server enable is the way in. One catch on that path: from OpenSSH 9.0 the scp command uses the SFTP protocol by default, so a copy from a modern Linux host logs in and then fails with scp: Connection closed. Add -O to force the classic SCP protocol, as Cisco’s note on OpenSSH 9.0 clients explains. The classic IOS 15.2 image in our lab has no SFTP client at all.
R2# copy sftp: ?
% Unrecognized command
On a platform that has the client, an SFTP copy is an SSH session started by the router, so set its source address with ip ssh source-interface when a firewall in the path only allows a specific address. Cisco lists that as a prerequisite for SFTP client use, along with SSH itself. The URL and direction rules match SCP: source first, destination second.
Practice secure file transfer
These questions cover SCP and SFTP setup, copy direction and image verification.
CCNA practice: Domain 4: Network Services and Security
10 questions drawn fresh from 130 in the bank, with the answer and explanation after each one.
Start 10 questionsThe hostname and domain lines come from Cisco device base configuration. SCP depends on the SSH setup in configuring SSH on Cisco routers and switches, and the local account and AAA lines come from device access control with local passwords and RADIUS versus TACACS+. Secure file transfer with SFTP and SCP replaced TFTP and FTP in the CCNA 200-301 v2.0 topics, and the Domain 4 practice test drills it with the rest of network services and security.
Why SCP replaced TFTP for config backups
TFTP is still the default answer in older runbooks, and it is worth knowing exactly what you give up by keeping it.
| Protocol | Transport | Authentication | Encryption |
|---|---|---|---|
| TFTP | UDP 69 | None | None |
| FTP | TCP 20 and 21 | Username and password in clear text | None |
| SCP | SSH, TCP 22 | SSH login | SSH |
| SFTP | SSH, TCP 22 | SSH login | SSH |
A running configuration carries SNMP communities, TACACS+ keys and password hashes, so a TFTP backup hands all of them to anyone who can capture the traffic. Cisco’s IOS hardening guide recommends SCP over FTP and TFTP for exactly that reason. Once the server side is set up, SCP costs one extra prompt per copy, which is a cheap trade.