思科交换机

telnet配置

1.配置用户名口令

username cisco password cisco123

2.配置enable口令

enable secret cisco123  (密文显示)

2.vty模式下启用本地认证

line vty 0 4

login local

session-timeout 1

console配置

1.配置enable口令

enable secret cisco123

2.在console模式下启用口令认证

line console 0

passwd cisco123

login

ssh配置

1.启用本地aaa认证

aaa new-model

2.配置主机名

hostname hw-sw-01

2.配置本地用户名口令

username cisco passwd cisco123

3.配置ssh

ipdomain-name cisco.com

crypto key generate rsa

4.vty模式下仅允许使用ssh访问

line vty 0 4

transport input ssh

华为交换机

telnet密码验证

1.vty模式下配置

user-interface vty 0 4

set authentication passwd simple huawei  (设置明文口令)

authentication-mode password (验证方式为口令)

user privilege level 3 (设置特权级别)

telnet用户名口令验证

1.vty模式下配置用户名口令验证方式

user-interface vty 0 4

authentication-mode scheme

2.配置本地用户

local-user huawei  (添加本地用户)

password simple huawei  (设置用户口令)

service-type telnet level 3  (服务类型及特权级别)

console口密码验证

1.aux模式下配置

user-interface aux 0

set authentication password simple huawei

authentication-mode password

user privilege level 3

console用户名口令验证

1.aux模式下配置

user-interface aux 0

authentication-mode scheme

2.配置本地用户

local-user huawei

password simple huawei

service-type telnet level 3  (console访问如果想做用户名与口令访问,则telnet或者ssh访问必须要添加,否则不能配置)

当然还需要配置一个vlan管理地址,否则是没办法访问的。