本案例采用思科模拟器的S3560交换机来模拟SSH的典型组网配置,通过在S3560交换机配置SSH,实现交换机的远程登录管理。
1、在交换机配置VLAN。
2、在交换机配置SSH。
3、PC填写IP,能PING通交换机。
4、在PC上ssh登录交换机
Switch>ena
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hos MSW
MSW(config)#vlan 10
MSW(config-vlan)#exit
MSW(config)#int f 0/1
MSW(config-if)#sw mo acc
MSW(config-if)#sw acc vlan 10
MSW(config-if)#exit
MSW(config)#int vlan 10
MSW(config-if)#ip address 192.168.1.1 255.255.255.0
MSW(config-if)#no shutdown
MSW(config-if)#exit
MSW(config)#ip routing
SSH配置关键点:
MSW(config)#username admin privilege 15 password 0 admin //创建用户名、密码
MSW(config)#enable secret admin //配置特权密码
MSW(config)#ip domain name h3c.com //配置dns域名
MSW(config)#aaa new-model //使用本地数据库,模式为AAA
MSW(config)#crypto key generate rsa //创建密钥
The name for the keys will be: MSW.h3c.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 //密钥长度配置为1024比特的长度
% Generating 1024 bit RSA keys, keys will be non-exportable...[OK]
MSW(config)#ip ssh version 2 //配置ssh的版本为2
MSW(config)#ip ssh authentication-retries 5
MSW(config)#ip ssh time-out 60
MSW(config)#line vty 0 4
MSW(config-line)#login
MSW(config-line)#transport input ssh
MSW(config-line)#exit
电脑填写IP地址:
电脑能PING通交换机
电脑能SSH登录交换机
至此,思科交换机SSH配置已完成。
该案例暂时没有网友评论
✖
案例意见反馈
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作