1、telnet
是应用层协议,基于传输层TCP,默认端口号:23,采用的是明文密码方式,不是很安全,一般用于内网管理。
2、ssh
是应用层协议,基于传输层TCP,默认端口号22,采用的是密文密码方式,相对来讲比较安全,经常用于跨越互联网管理,也常用于远程管理Linux操作系统
3、思路
- 既然是通过网络的方式进行管理设备,设备就必须配置IP地址,由于交换机上的接口都是交换接口,是不允许配置IP地址,直接为交换机的虚接口配置IP地址,默认情况下交换机的默认虚接口就是vlan1接口
Switch(config)#int vlan1
Switch(config-if)#ip address 192.168.100.100 255.255.255.0
Switch(config-if)#no shutdown
- 配备设备的连接终端并直接设置密码,应用
Switch#conf t
Switch(config)#line vty 0 4
Switch(config-line)#password woniu123
Switch(config-line)#login #表示直接使用密码登录
- 创建连接用户名密码,配置设备的连接终端并应用
Switch#conf t
Switch(config)#username LVbo password 520520
Switch(config)#line vty 0 4
Switch(config-line)#login local #表示使用用户名密码登录
ssh
Switch(config)#hostname SW1
SW1(config)#ip domain-name LVbo.com
SW1(config)#crypto key generate rsa
The name for the keys will be: SW1.LVbo.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]:
% Generating 512 bit RSA keys, keys will be non-exportable…[OK]
SW1(config)#ip ssh time-out 120
SW1(config)#ip ssh aut
SW1(config)#ip ssh authentication-retries 5
SW1(config)#username LVbo password 520520
SW1(config)#line vty 0 4
SW1(config-line)#login local
4、设置特权模式密码
SW1(config)#enable password 520520
SW1(config)#enable secret 1314
SW1#show running-config #查看当前配置文件命令