您的位置首页生活百科

Juniper 防火墙用户登录配置

Juniper 防火墙用户登录配置

的有关信息介绍如下:

Juniper 防火墙用户登录配置

默认情况下,Juniper防火墙第一次使用Console登录操作系统时,用户root密码为空,当你新增了其他配置内容,也需要配置root根密码才能提交配置。为了保险起见,建议再配置一个Super-user的class类的用户,例如lab或经常使用的用户名。一旦登录不进操作系统,就需要将设备进行断电重启进行密码恢复,这样比较浪费时间,尤其新上架设备,变更的时候,时间就更宝贵。 Junos支持本地用户的认证和3A服务器认证,3A认证通常是使用Tacacs+或Radius认证,对于3A服务器认证,可结合思科的ACS进行授权、审计等相关参数配置认证。 本文章只是本地的用户登录管理用户配置,后续就列出3A认证内容。 

通过Console线接入防火墙配置防火墙的管理IP地址及开启SSH服务

Note: 若是选取物理接口作为管理IP地址时,需要将接口划入对应的Zone

[edit]

root@srx-02# show interfaces | display set | match ge-0/0/0

set interfaces ge-0/0/0 unit 0 family inet address 192.168.136.12/24

[edit]

root@srx-02# show security zones | display set | match ge-0/0/0

set security zones security-zone trust interfaces ge-0/0/0.0 host-inbound-traffic system-services all

set security zones security-zone trust interfaces ge-0/0/0.0 host-inbound-traffic protocols all

[edit]

root@srx-02# show system services | display set | match ssh

set system services ssh

set system services netconf ssh

Note: 这里也对应的开启了Telnet服务

通过Console进入防火墙操作界面后,配置根用户及Super-user的lab

[edit]

root@srx-02# set system root-authentication plain-text-password

New password:

Retype new password:

Note: 输入的密码是隐藏的,直接输入即可;

[edit]

root@srx-02# set system login user lab class super-user authentication plain-text-password

New password:

Retype new password:

如下图所示,提交配置之后

使用命令

show | compare 进行对比确认

对步骤2之后提交commit配置后,使用Lab用户进行登录认证,如下图所示,Lab用户已成功登录。

使用命令“show cli authorization "可以查看到当前的用户的权限。

如Lab用户登录到防火墙上,显示的Super-user权限,即是超级用户管理员的权限。

防火墙上查看登录的用户连接线,当防火墙上挂了太多的登录用户时,可以使用以下命令进行剔除。

root@srx-02> show system users

9:47AM up 4 days, 2:28, 5 users, load averages: 0.00, 0.02, 0.00

USER TTY FROM LOGIN@ IDLE WHAT

root v0 - 11Jun17 16 /bin/csh

lab p0 192.168.136.1 7:20AM 18 -cli (cli)

root p1 192.168.136.1 9:30AM 16 -csh (csh)

root p3 192.168.136.1 9:33AM - cli

lab jweb1 192.168.136.1 7:22AM 2:24

root@srx-02> request system logout user lab

logout-user: done

root@srx-02> show system users

9:48AM up 4 days, 2:29, 3 users, load averages: 0.03, 0.03, 0.00

USER TTY FROM LOGIN@ IDLE WHAT

root v0 - 11Jun17 17 /bin/csh

root p1 192.168.136.1 9:30AM 18 -csh (csh)

root p3 192.168.136.1 9:33AM - cli

通过Log messages查看登录的用户记录日志,默认情况下,Junos会保存10分日志Messages,日志的大小及数量可自定义。

root@srx-02> show configuration | display set | match syslog

set system syslog user * any emergency

set system syslog file messages any info

set system syslog file messages authorization info

set system syslog file interactive-commands interactive-commands any

Note: 以上日志为对应的日志级别为Info。

root@srx-02> show log messages | match lab

Sep 4 09:43:58 srx-02 login: Login attempt for user lab from host 192.168.136.1

Sep 4 09:43:59 srx-02 login: LOGIN_INFORMATION: User lab logged in from host 192.168.136.1 on device ttyp2

Sep 4 09:43:59 srx-02 mgd: UI_AUTH_EVENT: Authenticated user 'lab' at permission level 'j-super-user'

Sep 4 09:43:59 srx-02 mgd: UI_LOGIN_EVENT: User 'lab' login, class 'j-super-user' , ssh-connection '', client-mode 'cli'

Sep 4 09:45:14 srx-02 mgd: UI_CMDLINE_READ_LINE: User 'lab', command 'show cli authorization '

Sep 4 09:45:31 srx-02 mgd: UI_LOGOUT_EVENT: User 'lab' logout