思科SCP协议

1、 SCP:Secure Copy Protocol 安全复制协议
2、 SCP通过认证的方式为Cisco设备的配置和映像复制提供安全,这种安全是基于SSH的。
3、 在配置SCP之前,必须配置SSH,认证和授权。正因为有了SSH和AAA这样的机制所以能够确定用户是否是合法的。

1、案例配置拓扑
在这里插入图片描述

2、 在R1上配置SSH:
R1(config)#hostname R1
R1(config)#ip domain name www.cisco.com
R1(config)#username ccie privilege 15 password cisco
R1(config)#crypto key generate rsa
The name for the keys will be: R1.www.cisco.com
Choose the size of the key modulus in the range of 360 to 2048 for your
General Purpose Keys. Choosing a key modulus greater than 512 may take a few minutes.
How many bits in the modulus [512]: 1024
% Generating 1024 bit RSA keys, keys will be non-exportable…[OK]
R1(config)#line vty 0 4
R1(config-line)#transport input ssh
R1(config-line)#login local

在R2上远程SSH登录到R1
R2#ssh -l ccie 12.1.1.1
Password: cisco
R1#

3、 在R1上配置AAA认证,SSH认证方式采用本地数据库认证;
R1
R1(config)#aaa new-model /开启AAA认证功能/
R1(config)#aaa authentication login default local /指定用户登录认证方式采用本地数据库认证/
R1(config)#aaa authorization exec default local /授权方式采用本地用户数据库进行授权/

在R2上远程SSH登录到R1
R2#ssh -l ccie 12.1.1.1
Password: cisco
R1#

4、 配置SCP,让R2能够copy文件到R1;
R1(config)#ip scp server enable /开启SCP服务/

4 案例检验结果
1、 在R2的flash中创建一个文件:
R2#show running-config | redirect flash:R2configuration
/将R2 show running-config的内容保存到flash中,文件名称为R2configuration/
R2#dir /验证R2 flash中是否存在R2configuration/
Directory of flash:/
1 -rw- 752 R2configuration
8388604 bytes total (8387788 bytes free)

R2#copy flash:R2configuration scp://ccie@12.1.1.1 /通过SCP方式拷贝文件到R1/
Address or name of remote host [12.1.1.1]?
Destination username [ccie]?
Destination filename [R2configuration]?
Writing R2configuration
Password:
!
752 bytes copied in 1.856 secs (405 bytes/sec)

注意:copy flash:R2configuration scp://ccie@12.1.1.1,
flash:R2configuration文件所在的位置和名称
ccie 用户名
12.1.1.1 目标地址

R1#dir /验证R1 flash中是否收到R2拷贝过来的R2configuration/
Directory of flash:/
1 -rw- 752 R2configuration
8388604 bytes total (8387788 bytes free)

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值