最佳答案
您好,请参考
1.生成RSA和DSA密钥对
[H3C]public-key local create rsa
[H3C]public-key local create dsa
2.设置用户接口上的认证模式为AAA,并让用户接口支持SSH协议
[H3C]user-interface vty 0 4
[H3C-ui-vty0-4]authentication-mode scheme
[H3C-ui-vty0-4]protocol inbound ssh
3.创建用户admin,设置认证密码为luwenju-!@# 登录协议为SSH,能访问的命令级别 为 3
[H3C]local-user admin
[H3C-luser-admin]password cipher luwenju-!@#
[H3C-luser-admin]service-type ssh level 3
4.指定用户admin的认证方式为password
[H3C]ssh user admin authentication-type
password
# 进入系统视图,并开启ssh服务,默认开启。
<H3C> system-view
[H3C] SSH server enable
# 创建本地账号abc,密码为123456,权限级别为network-admin。//如果现场同一个本地用户既需要通过ssh登录,又需要console登录,则服务器类型需要添加 terminal
[H3C] local-user abc
[H3C-luser-abc] password simple 123456
[H3C-luser-abc] service-type ssh terminal
[H3C-luser-abc] authorization-attribute user-role network-admin
[H3C-luser-abc] quit
# 配置VTY接口认证模式为scheme模式(用户名+密码认证)。用于ssh登录
[H3C] line vty 0 4
[H3C-ui-vty0-4] authentication-mode scheme //另两种认证模式为None(无密码)和Password(单密码)
[H3C-ui-vty0-4] quit
(0)
暂无评论
您好,请知:
以下是SSH配置的关键点:
1、基础网络配置:
<H3C>sys
System View: return to User View with Ctrl+Z.
[H3C]vlan 10
[H3C-vlan10]quit
[H3C]int vlan 10
[H3C-Vlan-interface10]ip address 192.168.124.254 24
[H3C-Vlan-interface10]quit
[H3C]int gi 1/0/1
[H3C-GigabitEthernet1/0/1]port link-type access
[H3C-GigabitEthernet1/0/1]port access vlan 10
[H3C-GigabitEthernet1/0/1]quit
2、创建管理员账号,并赋予最高权限,仅允许SSH登录
[H3C]local-user admin
New local user added.
[H3C-luser-manage-admin]password simple admin
[H3C-luser-manage-admin]service-type ssh
[H3C-luser-manage-admin]authorization-attribute user-role network-admin
[H3C-luser-manage-admin]quit
4、开启SSH功能
[H3C]ssh server enable
5、在VTY调用本地用户登录
[H3C]line vty 0 4
[H3C-line-vty0-4]authentication-mode scheme
[H3C-line-vty0-4]protocol inbound ssh
[H3C-line-vty0-4]quit
(0)
暂无评论
本案例适用于如S5130S-28S-SI、S5500V2-24P-WiNet等的V7交换机,V5、V7交换机具体分类及型号可以参考“1.1 Comware V5、V7平台交换机分类说明”。
Host(SSH客户端)与Switch建立本地连接。Host采用SSH协议登录到Switch上,以保证数据信息交换的安全。此处采用的认证方式为password认证,用户名和密码保存在Switch上。
# 生成RSA密钥对。
<H3C>system-view
System View: return to User View with Ctrl+Z.
[H3C]public-key local create rsa
The range of public key size is (512 ~ 2048).
NOTES: If the key modulus is greater than 512,
It will take a few minutes.
Press CTRL+C to abort.
Input the bits of the modulus[default = 1024]:
Generating Keys...
++++++++++++++++++++++++++++++++++++++
+++++++++++
+++++++++++++
+++
# 生成DSA密钥对。
[H3C]public-key local create dsa
The range of public key size is (512 ~ 2048).
NOTES: If the key modulus is greater than 512,
It will take a few minutes.
Press CTRL+C to abort.
Input the bits of the modulus[default = 1024]:
Generating Keys...
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++*+++++++++++++
# 启动SSH服务器。
[H3C]ssh server enable
Info: Enable SSH server.
# 配置VLAN虚接口Vlan-interface 1的IP地址为192.168.1.1,此地址作为SSH服务器的登录地址。
[H3C]interface Vlan-interface 1
[H3C-Vlan-interface1] ip address 192.168.1.1 255.255.255.0
[H3C-Vlan-interface1]quit
# 设置SSH客户端登录用户界面的认证方式为scheme方式。
[H3C] line vty 0 4
[H3C- line-vty0-4]authentication-mode scheme
# 设置Switch上远程用户登录协议为SSH。
[H3C- line-vty0-4]protocol inbound ssh
[H3C- line-vty0-4]quit
# 创建本地用户client001,密码为aabbcc,并设置用户访问的命令级别为network-admin。
[H3C]local-user client001
[H3C-luser-client001]password simple aabbcc
[H3C-luser-client001]service-type ssh
[H3C-luser-client001]authorization-attribute user-role network-admin
[H3C-luser-client001]quit
#保存配置
[H3C]save force
(0)
暂无评论
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
暂无评论