锐捷配置ssh

  1. 开启交换机的SSH服务功能

    Ruijie#configure  terminal

    Ruijie(config)#enable service ssh-server  

  2. 2

    生成加密密钥:

    Ruijie(config)#crypto key generate  dsa   ------>加密方式有两种:DSA和RSA,可以随意选择

    Choose the size of the key modulus in  the range of 360 to 2048 for your

    Signature Keys. Choosing a key modulus  greater than 512 may take a few minutes.

    How many bits in the modulus [512]:                 ------>直接敲回车

    % Generating 512 bit DSA keys  ...[ok]

  3. 3

    配置交换机的管理IP地址 

    Ruijie(config)#interface  vlan 1

    Ruijie(config-if)#  ip address 192.168.1.1 255.255.255.0 

  4. 4

    需求一:SSH时仅使用密码登入交换机

    Ruijie(config)#line  vty 0 4                                              ------>  进入SSH密码配置模式,0  4表示允许共5个用户同时SSH登入到交换机

    Ruijie(config-line)#login                                                ------>启用需输入密码才能SSH成功

    Ruijie(config-line)#password  ruijie                                ------>  将SSH密码设置为ruijie

    Ruijie(config-line)#exit                                                  ------>  回到全局配置模式

    Ruijie(config)#enable  password  ruijie                           ------>配置进入特权模式的密码为ruijie

    Ruijie(config)#end                                                        ------>退出到特权模式

    Ruijie#write                                                                  ------>确认配置正确,保存配置

  5. 5

    需求二:SSH时使用用户名及密码登入交换机

    Ruijie(config)#line  vty 0 4                                             ------>进入SSH密码配置模式,0  4表示允许共5个用户同时SSH登入到交换机

    Ruijie(config-line)#login  local                                        ------>启用SSH时使用本地用户和密码功能

    Ruijie(config-line)#exit                                                  ------>回到全局配置模式

    Ruijie(config)#username  admin password ruijie             ------>配置远程登入的用户名为admin,密码为ruijie

    Ruijie(config)#enable  password  ruijie                          ------>配置进入特权模式的密码为ruijie

    Ruijie(config)#end                                                        ------>退出到特权模式

    Ruijie#write                                                                  ------>确认配置正确,保存配置

     

  6. 6

    限制只能使用SSH登录交换机

    Ruijie(config)#line  vty 0 4       

    Ruijie(config-line)#transport  input ssh

    Ruijie#write   

posted @ 2022-03-08 16:53  xuxianglu  阅读(180)  评论(0编辑  收藏  举报