思科ssh链接交换机配置


拓扑图

 

 

 

 

 

 

 配置教程

一.添加pc0的ip为192.168.1.2

 

交换机配置 

Switch>ena

Switch#conf t

Enter configuration commands, one per line. End with CNTL/Z.

Switch(config)#ip domain-name cnblogs.com  //绑定域名为cnblogs.com

Switch(config)#ho s1 //命名交换机为s1

s1(config)#cr key generate rsa  //生成RSA 秘钥

The name for the keys will be: s1.cnblogs.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  //最大2048位

% Generating 1024 bit RSA keys, keys will be non-exportable...[OK]

s1(config)#enable password s1   //设置特权模式密码为s1

s1(config)#username s1 secret s1  //设置交换机用户名为s1 密码为s1

s1(config)#line vty 0 15  创建vty线路

s1(config-line)#transport input ssh  

s1(config-line)#login local

s1(config-line)#int vlan 1  //因为所有通道在端口未被配置ip的情况下默认使用VLAN1

s1(config-if)#ip ad 192.168.1.1 255.255.255.0

s1(config-if)#no sh

s1(config-if)#

%LINK-5-CHANGED: Interface Vlan1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to up

s1(config-if)#

配置完成

使用pc0 ping 交换机刚刚配置的ip:192.168.1.1

 

 使用pc0 ssh链接交换机

使用命令:

ssh -l s1(刚刚的用户名)192.168.1.1(配置的ip)

 

 注意:输入密码时通常不会显示明文密码,是需要输入刚刚设置的密码:s1

 

成功用ssh进入交换机

为了交换机的安全通常会将特权模式设置一个密码,当设备退出特权模式或使用ssh链接使用特权模式时会要求输入特权模式的密码

 

 这里也一样,不会显示明文密码

输入刚刚设置的密码后进入特权模式

 

 

配置完成

 注:两层交换机和三层交换机配置一样


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM