zoukankan      html  css  js  c++  java
  • Juniper SRX 简单命令二

    --------------------------Juniper SRX 用户管理---------------------------

    Juniper的命令,其实是比较形象的,英文稍微好一点,基本都能看懂

    1、添加用户

    root# set system login user ?                  
    Possible completions:
      <user-name>          User name (login)

    2、用户组设置

    root# set system login user XXX class ?
    Possible completions:
      <class>              Login class
      operator             permissions [ clear network reset trace view ]        //用于故障定位,但是看不了配置,也不能编辑
      read-only            permissions [ view ]            //只读   就是只能看看状态
      super-user           permissions [ all ]              //完全权限
      unauthorized         permissions [ none ]         //为radius做模板,没有任何权限,权限在radius里添加

    根据不同用途给用户设置组

    3、用户UID设置

    root# set system login user XXX class read-only uid ?

    Possible completions:
      <uid>                User identifier (uid) (100..64000)

    4、root密码设置

    初始话的时候,root的密码为空,必须设置一个root密码才能提交配置.

    root# set system root-authentication plain-text-password         交互明文输入

    或者

    root# set system root-authentication encrypted-password ?     非交互密文输入
    Possible completions:
      <encrypted-password>  Encrypted password string

    例:root# set system root-authentication encrypted-password "xxxxxxxxxxdddddddddde"

    双引号里就是一个MD5加密的值

    这里不明白的看看之前一篇博客

    5、给用户设置密码

    root# set system login user XXX authentication plain-text-password

    或者

    root# set system login user XXX authentication encrypted-password "xxxxx"

    6、自定义用户级别组

    root# set system login class test ?
    Possible completions:
      access-end           End time for remote access (hh:mm)
      access-start         Start time for remote access (hh:mm)
      allow-commands       Regular expression for commands to allow explicitly
      allow-configuration  Regular expression for configure to allow explicitly
    + allow-configuration-regexps  Object path regular expressions to allow
    + allowed-days         Day(s) of week when access is allowed.
    + apply-groups         Groups from which to inherit configuration data
    + apply-groups-except  Don't inherit configuration data from these groups
      deny-commands        Regular expression for commands to deny explicitly
      deny-configuration   Regular expression for configure to deny explicitly
    + deny-configuration-regexps  Object path regular expressions to deny
      idle-timeout         Maximum idle time before logout (minutes)
      login-alarms         Display system alarms when logging in
      login-script         Execute this login-script when logging in
      login-tip            Display tip when logging in
    + permissions          Set of permitted operation categories
      security-role        Common Criteria security role

    可以自定义一个组,里面茫茫多的选项。。。。。。自己看看吧,反正我这里网络、服务器、桌面端、DBA就我一个人。。。。。。。。

    7、查看当前用户权限

    root> show cli authorization

    ——————————————————JuniperSRX------------------远程管理

    一、SSH(安全协议)

    set system services ssh root-login deny ----------------------------不允许管理员使用ssh登录
    set system services ssh protocol-version v2 -----------------------使用ssh 版本2

    set system services ssh connection-limit 3 -------------------------ssh最大连接数为3
    set system services ssh rate-limit 3-----------------------------------每分钟尝试密码次数

    二、Telnet(不安全协议)

    set system services telnet connection-limit 3---------------------最大连接数
    set system services telnet rate-limit 2------------------------------每分钟尝试密码次数

    三、FTP(不建议开服务端)

    1、作为服务端

    set system services ftp connection-limit 5---------------------最大连接数
    set system services ftp rate-limit 3------------------------------每分钟尝试密码次数

    现在一般都不用这种,通过软件直接SCP拖拽

    四、http/https

    1、http

    set system services web-management http port 8080---------设置打开服务并且指定8080端口
    set system services web-management http interface ge-0/0/0.0------------设置通过ge-0/0/0.0接口访问

    set system services web-management session idle-timeout 10------------设置超时时间10分钟
    set system services web-management session session-limit 1-----------设置最大连接数

    2、https

    set system services web-management https port 443
    set system services web-management https system-generated-certificate--------系统自动生成证书
    set system services web-management https interface ge-0/0/0.0

    上面设置session的那一段,是同时设置http和https的。

    3、NTP

    root# set system ntp server 2.2.2.2-----------设置ntp服务器

    root# set system ntp source-address 1.1.1.1  ----------设置访问NTP的源地址

    4、远程服务流量控制

    JuniperSRX分为转发引擎(PFE---packet forwarding engine)和路由引擎(RE---routing engine)。

    web  route  http 等等都是再RE上的,PFE功能简化来说就是二层转发。

    FW一般作为边界设备,肯定会连接公网,上面就会有很多端口扫描的问题,(傻逼真的是多),而流量的走向都是先通过FW---->loopback0----->RE(这个是我方便描述),lo0可以理解为一个管理接口,如果你把这个接口做了流量控制,就然就可以控制web的流量了。之后我会开一个实验专题,这里就不详解了

    静态路由

    静态路由都是最基础,小型公司用的最多的,我直接贴配置

    set routing-options static route 0.0.0.0/0 next-hop 1.1.1.1

    这就是一条默认的路由,下一跳地址是1.1.1.1

    JuniperSRX---------rpm配合track完成双线主备

    原理就是通过rpm的ping包去检测一个目标地址  然后根据结果切换路由

    services {
        rpm {
            probe ISP-PING {
                test ISP_DNS {
                    target address 1.1.1.2;           目标地址
                    probe-count 15;                      一次测试发几个包
                    probe-interval 1;                     每个包间隔几秒
                    test-interval 1;                        每个测试间隔几秒
                    thresholds {
                        successive-loss 5;              每个测试范围内,连续丢包多少个判断链路失效
                        total-loss 10;                      每个测试范围内,总丢包多少个判断链路失效
                    }
                    destination-interface ge-0/0/0.0;
                    next-hop 1.1.1.2;
                }
            }
        }
        ip-monitoring {
            policy DNS-Tracking {
                match {
                    rpm-probe ISP-PING;          需要满足的条件
                }
                then {
                    preferred-route {
                        route 0.0.0.0/0 {
                            next-hop 3.3.3.3;         需要更换的路由下一跳
                        }
                    }
                }
            }
        }
    }

    全部做完还要方形rpm的流量

    host-inbound-traffic {
                    system-services {
                        rpm;
                        ping;
                    }
                }

    原文链接    https://blog.csdn.net/tyrantu1989/article/list/2?t=1 

  • 相关阅读:
    《Advanced Bash-scripting Guide》学习(四):一个显示时间日期登录用户的脚本
    《Advanced Bash-scripting Guide》学习(三):自删除脚本和自读取内容的脚本
    51nod 1005 大数加法
    51nod1019 逆序数
    scoi2010 幸运数字
    COGS 513 八
    [HNOI2006]超级英雄Hero
    NOIP2010 关押罪犯
    [Scoi2010]游戏
    bzoj 2820: YY的GCD
  • 原文地址:https://www.cnblogs.com/jjp816/p/9426745.html
Copyright © 2011-2022 走看看