目录
实验拓扑如下:
一、telnet登录(本地认证两种方式)
二、telnet登录(aaa认证方式)
三、ssh登录
实验拓扑如下:
一、telnet登录(本地认证两种方式)
开启telnet服务器功能
telnet server enable
配置远程会话(不认证方式)
user-interface vty 0 4
authentication-mode none
测试结果:(无需账号密码直接登录成功)
配置远程会话:(密码认证)
set authentication password simple Huawei
测试结果:(输入密码后成功登录)
二、telnet登录(aaa认证方式)
开启telnet服务器功能
telnet server enable
配置aaa认证方案
aaa
local-user admin password simple Huawei //创建用户及密码
local-user admin privilege level 15 //设置用户权限等级
local-user admin service-type telnet //配置用户服务类型协议为telnet
配置远程会话
user-interface vty 0 4 //vty远程登录会话数量
authentication-mode aaa //设置认证方式为aaa认证
protocol inbound telnet //允许vty用户支持的协议
测试结果如下:
三、ssh登录
开启ssh功能
stelnet server enable
生成本地密钥对
[Radius]rsa local-key-pair create
The key name will be: Radius_Host
% RSA keys defined for Radius_Host already exist.
Confirm to replace them? [y/n]:y //因为已经配置过,询问是否替换钥对
The range of public key size is (512 ~ 2048).
NOTES: If the key modulus is greater than 512,
it will take a few minutes.
Input the bits in the modulus[default = 512]: //密钥长度
Generating keys...
.++++++++++++
...................++++++++++++
......++++++++
.......++++++++
[Radius]
配置aaa认证方案
aaa
local-user huawei password simple huawei
local-user huawei privilege level 15
local-user huawei service-type ssh
配置远程会话
user-interface vty 0 4
authentication-mode aaa
protocol inbound ssh //配置vty用户支持的协议
配置ssh用户以及认证类型和服务类型
ssh user huawei authentication-type password //创建ssh用户以及设置认证类型
ssh user huawei service-type stelnet
测试结果
第一次登录会提示Please run the command "ssh client first-time enable"to enable the first-time ac
cess function and try again. //需要运行命令开启ssh客户端首次运行 ssh client first-time enable
开启后再次登录:
[User]stelnet 192.168.1.254
Please input the username:huawei
Trying 192.168.1.254 ...
Press CTRL+K to abort
Connected to 192.168.1.254 ...
The server is not authenticated. Continue to access it? [Y/N] :y //提示服务器未通过身份验证,是否继续
Save the server's public key? [Y/N] :y //是否保存服务器的公钥
保存后可以通过命令进行查看,在客户端交换机上输入:display rsa peer-public-key 查看保存的公钥
、
The server's public key will be saved with the name 192.168.1.254. Please wait..
.
输入密码后成功登录: