交换机远程登录配置

AAA是认证(Authentication)、授权(Authorization)和计费(Accounting)的简称,是网络安全中进行访问控制的一种安全管理机制,提供认证、授权和计费三种安全服务。

Telnet 远程登陆 ,明文传输

SSH 远程登陆,密文传输 ssh server-source all-interface

配置console连接密码

一、纯密码(password模式)

1、[R2]user-interface console 0 #进入用户接口

2、[R2-ui-console0]authentication-mode password #认证方式选择password密码认证

3、按回车后提示Please configure the login password (maximum length 16): #直接输入密码

4、验证是否生效,直接退出设备重新登陆即可
#如果需要配置无密码登录,认证方式选择 none
authentication-mode none

二、用户名+密码(aaa认证模式)

1、[R2]user-interface console 0 #进入用户接口

2、[R2-ui-console0]authentication-mode aaa #认证方式选择aaa密码认证

3、[R2-ui-console0]aaa #输入aaa ,进入aaa模式

4、[R2-aaa]local-user ljq password cipher 123456 # 创建用户:ljq 密码:123456 ,其中cipher表示加密密码,这样查看设备配置时不会明文显示密码

配置telnet密码登录

注:vty一般指虚拟终端,理解为telnet需要的虚拟终端线路。Vty 0 4 ,表示同时允许0至4个用户登陆

一、纯密码

1、[R2]user-interface vty 0 4 # 进入接口
2、[R2-ui-vty0-4]authentication-mode password #设置认证模式为密码,按回车后输入密码

3、[R2-ui-vty0-4]user privilege level 15 #设置权限大小,0<1<2 ; 3-15,15最大
4、使用telnet登陆验证是否生效

配置telnet 用户+密码登录

1、[R2]user-interface vty 0 4 # 进入接口
2、[R2-ui-vty0-4]authentication-mode aaa #设置认证模式为aaa

3、[R2-ui-vty0-4]aaa #输入aaa
4、[R2-aaa]local-user ljq password cipher 123456 privilege level 15
#创建用户名:ljq 密码:123456 权限级别15

5、使用telnet登陆验证是否生效

 

配置ssh登录

Stelnet server enable #开启ssh服务

第一部分 :配置虚拟接口
[R2]user-interface vty 0 4 # 进入接口
[R2-ui-vty0-4]authentication-mode aaa #设置认证模式为aaa
[R2-ui-vty0-4]protocol inbound ssh #指定VTY类型用户只支持SSH协议(设备将自动禁止Telnet功能),按需选择如需要telnet 在后面输入即可,需要所有方式都能访问也可以输入 all

第二部分:创建远程登录用户
[R2]aaa #进入aaa视图

[R2-aaa]local-user huawei password cipher huawei privilege level 15 #创建用户:huaiwe, 密码huawei,用户级别15
[R2-aaa]local-user huawei service-type ssh #声明此用户只用来进行ssh连接,默认情况是telnet

需要两种连接方式共用一个用户,可以这样输入:local-user huawei service-type ssh telnet

如果需要创建一个用户只能登录telnet ,一个用户只能登录ssh,一个用户登录consolo

可以创建3个用户
local-user 用户名1 service-type telnet #指定用户名1,只能登录telnet
local-user 用户名2 service-type ssh #指定用户名2,只能登录ssh
local-user 用户名3 service-type Terminal #consolo口连接

登陆验证

[R1]stelnet 192.168.1.2 #ssh连接R2

Please input the username:huawei

Trying 192.168.1.2 …

Press CTRL+K to abort

Connected to 192.168.1.2 …

Error: Failed to verify the server’s public key.

Please run the command “ssh client first-time enable”to enable the first-time access function and try again. #第一次登陆会提示你输入**ssh client first-time enable**

[R1]ssh client first-time enable #按照提示输入

#然后重新进行连接

[R1]stelnet 192.168.1.2 Please input the username:huawei
Trying 192.168.1.2 …
Press CTRL+K to abort
Connected to 192.168.1.2 …
The server is not authenticated. Continue to access it? (y/n)[n]:y 直接输入y
[R1]
Save the server’s public key? (y/n)[n]:y #提示是否保存公钥,直接输入y
[R1]
Enter password: #然后输入密码huawei

© 版权声明
文章全是未果本果写的,尽量别直接复制粘贴
暂无评论

发送评论 编辑评论

上一篇
下一篇