华为ssh远程登陆;

如图:

让R1作为客户机,使r1 可以远程登陆R2

1.配置图上的ip

<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]un in en
Info: Information center is disabled.
[Huawei]sys R1
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip ad 192.168.12.1 24

R2 同上,ip ad 192.168.12.2 24

2.在R2上进入vty虚拟接口0 4 配置身份认证类型为aaa模式,登录协议为ssh
[R2]user-int vty 0 4 
[R2-ui-vty0-4]authentication-mode aaa
[R2-ui-vty0-4]protocol inbound ssh

3.进入aaa模式下创建一个用户user,设置3级权限,密码123,允许ssh登录
[R2-ui-vty0-4]aaa
[R2-aaa]local-user user password cipher 123
Info: Add a new user.
[R2-aaa]local-user user privilege level 3
[R2-aaa]local-user user service-type ssh

4。创建密钥对,用于加密传输数据,允许user用户使用任何验证方式,在aaa内开启stelnet服务。

[R2-aaa]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]:
Generating keys...
.......................++++++++++++
........++++++++++++
.................++++++++
................++++++++

[R2]user-int vty 0 4
[R2-ui-vty0-4]ssh user user authentication-type all
 Authentication type setted, and will be in effect next time.   
[R2]user-int vty 0 4
[R2-aaa]stelnet server enable
Info: Succeeded in starting the STELNET server.

在ssh客户端R1上启动第一次连接时的自动配置,指定自己要链接的ip
[R1]ssh client first-time enable 

[R1]stelnet 192.168.12.2
Please input the username:user
Trying 192.168.12.2 ...
Press CTRL+K to abort
Connected to 192.168.12.2 ...
Enter password:
<R2>

  • 22
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值