Router_A# conf terminal
Router_A(config)# ip scp server enable
Router_A(config)# end
Router_A#
Now on another router, say – Router_B do copy command:
Router_B# copy scp: flash:
Address or name of remote host []?192.168.2.254
Source username []? admin
Source filename []? /vlan.dat
Destination filename [vlan.dat]
!
780 bytes copied in 5.044 secs (155 bytes/sec)
Router_B#
However sometimes you can observe error like this:
%Error opening scp://*****@192.168.2.254/vlan.dat (No such file or directory)
Router_A# sh flash: | in vlan.dat
2 780 Dec 19 2016 09:02:54 +10:00 vlan.dat
Let’s enable debug on Router_A and see what’s going on:
Router_A#debug ip scp
Incoming SCP debugging is on
Router_A#
On Router_B run copy again:
Router_B#copy scp: flash:
Address or name of remote host [192.168.2.254]?
Source username [admin]?
Source filename [vlan.dat]?
Destination filename [vlan.dat]?
Password:
%Error opening scp://*****@192.168.2.254/vlan.dat (No such file or directory)
Let’s see what is in Router_A console:
May 23 14:22:50.968: SCP: [22 <- 192.168.1.1:65252] recv <OK>
May 23 14:22:50.968: SCP: [22 -> 192.168.1.1:65252] send Privilege denied.
Router_A#sh run | in aaa
aaa new-model
aaa authentication login default local
aaa authentication login userauthen local
aaa authorization commands 15 default local
Router_A(config)# aaa authorization exec default local
Router_A(config)#end
Router_A#
Router_B#copy scp: flash:
Address or name of remote host [192.168.2.254]?
Source username [admin]?
Source filename [vlan.dat]?
Destination filename [vlan.dat]?
Password:
!
780 bytes copied in 3.352 secs (233 bytes/sec)
Router_B#
Router_A#
May 23 14:30:40.199: SCP: [22 <- 192.168.1.1:12944] recv <OK>
May 23 14:30:40.203: SCP: [22 -> 192.168.1.1:12944] send C0644 780 vlan.dat
May 23 14:30:40.207: SCP: [22 <- 192.168.1.1:12944] recv <OK>
May 23 14:30:40.207: SCP: sent 780 bytes
May 23 14:30:40.207: SCP: [22 -> 192.168.1.1:12944] send <OK>
May 23 14:30:40.215: SCP: [22 <- 192.168.1.1:12944] recv <OK>
Problem solved!