华为路由器配置SSH认证登陆教程

华为路由器1:
sys //进入系统视图
[Huawei]interface g0/0/0 //进入g0/0/0配置
[Huawei-GigabitEthernet0/0/0]ip address 202.100.1.1 30 //配置IP地址为202.100.1.1 30
[Huawei-GigabitEthernet0/0/0]q
[Huawei]aaa //进入aaa
[HW-R1-aaa]local-user huawei password cipher m2m2.net//创建用户huawei和密码m2m2.net
[Huawei-aaa]local-user huawei service-type ssh //用户huawei认证默认是SSH
[Huawei-aaa]local-user huawei privilege level 15 //用户huawei用户权限15级
[Huawei-aaa]q //退出
[Huawei]ssh user huawei authentication-type password //SSH用户huawei认证模式是密码认证
Authentication type setted, and will be in effect next time
[Huawei]stelnet server enable //开启SSH认证服务
Info: Succeeded in starting the STELNET server.
[Huawei]rsa local-key-pair create //生成本地认证秘钥
The key name will be: Host
% RSA keys defined for Host already exist.
Confirm to replace them? (y/n)[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]:768 //默认512位密码,输入产生的秘钥长度(768)
Generating keys…
…++++++++
.++++++++
.+++++++++
.+++++++++
[Huawei]user-interface vty 0 4 //进入配置虚拟终端
[Huawei-ui-vty0-4]authentication-mode aaa //虚拟终端认证模式为AAA
[Huawei-ui-vty0-4]protocol inbound ssh //开启SSH
[Huawei-ui-vty0-4]q //退出
[Huawei]sys HW-R1 //设置设备名称HW-R1
[HW-R1]

华为路由器2:

sys //进入系统视图
[Huawei]interface g0/0/0 //进入g0/0/0配置
[Huawei-GigabitEthernet0/0/0]ip address 202.100.1.2 30 //配置IP地址为202.100.1.2 30
[Huawei-GigabitEthernet0/0/0]q //退出
[Huawei]ssh client first-time enable //开启SSH第一次登陆
[Huawei]stelnet 202.100.1.1
Please input the username:huawei //输入用户名huawei
Trying 202.100.1.1 …
Press CTRL+K to abort
Error: Failed to connect to the remote host.
[Huawei]stelnet 202.100.1.1
Please input the username:huawei
Trying 202.100.1.1 …
Press CTRL+K to abort
Error: Failed to connect to the remote host.
[Huawei]stelnet 202.100.1.1
Please input the username:huawei
Trying 202.100.1.1 …
Press CTRL+K to abort
Connected to 202.100.1.1 …
The server is not authenticated. Continue to access it? (y/n)[n]:y //是否接收秘钥
Jul 29 2019 16:43:31-08:00 Huawei %%01SSH/4/CONTINUE_KEYEXCHANGE(l)[1]:The server had not been authenticated in the process of exchanging keys. When deciding whether to continue, the user chose Y.
[Huawei]
Save the server’s public key? (y/n)[n]:y //是否保存秘钥在本地
The server’s public key will be saved with the name 202.100.1.1. Please wait…

Jul 29 2019 16:43:33-08:00 Huawei %%01SSH/4/SAVE_PUBLICKEY(l)[2]:When deciding whether to save the server’s public key 202.100.1.1, the user chose Y.
[Huawei]
Enter password: //输入密码
sys //进入系统视图
[HW-R1]
dis users
User-Intf Delay Type Network Address AuthenStatus AuthorcmdFlag
0 CON 0 00:02:26 pass Username : Unspecified

129 VTY 0 00:00:00 SSH 202.100.1.2 pass Username : huawei

  • 15
    点赞
  • 84
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
华为路由器SSH配置可以通过以下步骤完成: 1. 首先,确保路由器中支持SSH功能。 2. 生成本地密钥对。可以使用命令[R2rsa local-key-pair create来生成密钥对。 3. 创建SSH用户并配置登录认证方式。可以使用命令[R2user-interface vty 0 4来进入VTY接口配置模式,然后使用命令[R2-ui-vty0-4authentication-mode aaa来设置认证模式为AAA,再使用命令[R2-ui-vty0-4protocol inbound ssh来允许SSH协议的入站连接。 4. 配置SSH用户的密码。可以使用命令[R2aaa进入AAA配置模式,然后使用命令[R2-aaalocal-user huawei password cipher huawei来设置SSH用户的密码,并使用命令[R2-aaalocal-user huawei service-type ssh来设置SSH用户的服务类型为SSH。 以上是一种配置SSH的方法,通过这些步骤可以实现华为路由器SSH配置。引用引用引用<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [华为路由器/交换机配置telnet,ssh远程登录](https://blog.csdn.net/liwangjin0116/article/details/126596693)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *2* [华为网络设备SSH方式登录配置](https://blog.csdn.net/abc768047936abc/article/details/98105786)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值