access.conf is the configuration file used to logins to the Linux or Unix systems. This file is locate at /etc/security/ path.  With this file logins of users, groups, hosts, tty, network are defined to allows or disallowed status. Each line specifies a rule.

access.conf是用于登录Linux或Unix系统的配置文件。 该文件位于/etc/security/路径。 使用此文件,用户,组,主机,tty,网络的登录名被定义为允许或禁止状态。 每行指定一个规则。

句法 (Syntax)

permission:users/groups:origins

Show Services Using Access.conf

使用Access.conf显示服务

允许规则(Allow Rule)

As we stated before each line is a rule. The aim of the rules are allowing or denying access with related parameters. Allow rule is sign is + . Each line starting with + means allow. After the sign there is : to delimit rule parameters. In the example we allow some access for the root user.

如前所述,每行都是一条规则。 规则的目的是允许或拒绝具有相关参数的访问。 允许规则的符号是+ 。 每行以+开头表示允许。 在标志之后有:分隔规则参数。 在示例中,我们允许root用户进行某些访问。

+ : root : 192.168.200.1 192.168.200.4 192.168.200.9

拒绝规则 (Deny Rule)

Deny rule is used to deny access with specified parameters. Deny rules tarts with- sign and delimited with: from the rule parameters. Following example rules denies access for the root account.

拒绝规则用于拒绝具有指定参数的访问。 从规则参数中拒绝带有-号的规则rules,并以:分隔。 以下示例规则拒绝对根帐户的访问。

- : root : ALL

只允许根访问 (Allow Only Root Access)

There are different type of access restrictions. One of them is only allowing root user to access to the server. In this rule root user can access from everywhere to the system.

有不同类型的访问限制。 其中之一是仅允许root用户访问服务器。 在此规则中,root用户可以从任何地方访问系统。

+ : root : ALL

指定允许的用户 (Specify Allowed User)

We can specify the user account which can access to the server. We will give the user ismail access right to the server from everywhere.

我们可以指定可以访问服务器的用户帐户。 我们将使用户ismail从任何地方都可以访问服务器。

+ : ismail : ALL

指定允许的组 (Specify Allowed Group)

While specifying access for the user name if there area lot of users those can access to the server can be a problem for definition and management. Acess.conf supports Linux user groups. These groups can be used to give access to the server. We assume we have a group named remoteacess and this group members can access to the server from anywhere.

在为用户名指定访问权限时(如果有很多用户可以访问服务器)可能是定义和管理的问题。 Acess.conf支持Linux用户组。 这些组可用于授予对服务器的访问权限。 我们假设有一个名为remoteacess的组,该组成员可以从任何地方访问服务器。

+ : @admins : ALL

指定允许的主机 (Specify Allowed Hosts)

Another useful option is setting hosts those can be connect to the system. Host names or IP addresses can be specified like below. In the example we only allow IP address 192.168.200.1 to connect to the system.

另一个有用的选项是设置可以连接到系统的主机。 可以如下指定主机名或IP地址。 在该示例中,我们仅允许IP地址192.168.200.1连接到系统。

+ : root : 192.168.200.1

指定允许的网络 (Specify Allowed Network)

Specifying IP ranges one by one is daunting task. We can use network and netmask specification do define networks to allow access. In the following example we allow root user access from network 10.0.0.0/24 or 10.0.0.0-255 with 10.0.0. expression.

一一指定IP范围是一项艰巨的任务。 我们可以使用网络和网络掩码规范来定义允许访问的网络。 在下面的例子中,我们允许root从网络用户访问10.0.0.0/2410.0.0.0-25510.0.0. 表达。

+ : root : 10.0.0.

拒绝仅根访问 (Deny Only Root Access)

Previous examples we have looked how to allow some users, groups, IP addresses and networks to the system. But security comes from deny operation. Up to new we will look how to deny users with specified parameter to access to the system. In this example user root can not access system remotely from anywhere.

在前面的示例中,我们研究了如何允许某些用户,组,IP地址和网络进入系统。 但是安全性来自拒绝操作。 到最新为止,我们将研究如何拒绝具有指定参数的用户访问系统。 在此示例中, root用户无法从任何地方远程访问系统。

- : root : ALL

指定拒绝的用户 (Specify Denied User)

We can specify user to deny access to the system. In this example user ismail can not access to the system from anywhere.

我们可以指定用户拒绝对系统的访问。 在此示例中,用户ismail无法从任何地方访问系统。

- : ismail : ALL

指定允许的组 (Specify Allowed Group)

As shown previous examples a Linux user group can be defined fo deny access to the system. In the example we will deny access for students group from anywhere.

如前面的示例所示,可以定义Linux用户组以拒绝访问系统。 在示例中,我们将拒绝从任何地方访问students组。

- : @students : ALL

指定拒绝的主机 (Specify Denied Hosts)

We can specify hosts to deny access to the system. We will use same syntax like allow rule but change the rule sign with . In the example we  deny access from 192.168.200.1 to the system.

我们可以指定主机以拒绝对系统的访问。 我们将使用与allow rule相同的语法,但使用-更改规则符号。 在示例中,我们拒绝从192.168.200.1到系统的访问。

- : root : 192.168.200.1

指定拒绝的网络 (Specify Denied Network)

We can specify denied network with - sign, username and the network address. In the example we will deny 10.0.0.0/24 from accessing with root user to the system.

我们可以使用-符号,用户名和网络地址指定拒绝的网络。 在该示例中,我们将拒绝10.0.0.0/24通过root用户访问系统。

- : root : 10.0.0.

异常定义 (Exception Definition)

Up to now we have specified and defined the users , host names, groups and networks. We have the ability to except these. In the example we allow all users access to the system except root . We can also specify group names to except.

到目前为止,我们已经指定并定义了用户,主机名,组和网络。 我们有能力排除这些。 在该示例中,我们允许除root之外的所有用户访问系统。 我们还可以将组名指定为except。

+ : ALL EXCEPT (root) : ALL

全部拒绝 (Deny All)

The readers who worked with firewalls knows the golden rule. After specifying different access rules the best practice is defining last rule as DENY ALL . This will make system very secure. This simply imply that I only allow those connections I defined and deny all others. Put this rule to the end of the rules in access.conf file.

使用防火墙的读者知道黄金法则。 指定不同的访问规则后,最佳做法是将最后一个规则定义为DENY ALL 。 这将使系统非常安全。 这仅表示我只允许我定义的那些连接,而拒绝所有其他连接。 将此规则放在access.conf文件中规则的末尾。

- : ALL : ALL
LEARN MORE  SSH Tutorial With Command Examples
通过命令示例了解更多SSH教程

翻译自: https://www.poftut.com/access-conf-security-configuration-linux-unix/

Linux Access.conf安全配置的更多相关文章

  1. VMware Linux 下 Nginx 安装配置 - nginx.conf 配置 [负载两个 Tomcat] (三)

    首先启动Nginx 1. 相关浏览 两个 Tomcat 配置:  VMware Linux 下 Nginx 安装配置 - Tomcat 配置 (二) Nginx 安装配置启动: VMware Linu ...

  2. linux limits.conf 配置

    转自:http://kerry.blog.51cto.com/172631/300784 limits.conf 文件实际是 Linux PAM(插入式认证模块,Pluggable Authentic ...

  3. Linux 桌面系统字体配置要略

    字体显示效果测试 这一段是为了测试宋体字的显示效果,包括宋体里面自带的英文字体,“This is english,how does it look like?”.这一行是小字.后面几个字是加粗的宋体. ...

  4. Linux 桌面玩家指南:04. Linux 桌面系统字体配置要略

    特别说明:要在我的随笔后写评论的小伙伴们请注意了,我的博客开启了 MathJax 数学公式支持,MathJax 使用$标记数学公式的开始和结束.如果某条评论中出现了两个$,MathJax 会将两个$之 ...

  5. Linux 各类设置、配置、使用技巧参考,Linux使用集锦

    ========== 参考格式 (新增记录时,复制粘贴在下)============= [日期]: <标题> 参考链接ref1: 参考链接ref2: 正文: ========== 参考格式 ...

  6. 3-nginx.conf参数配置

    –#定义Nginx运行的用户和用户组 –user www www; –#nginx进程数,建议设置为等于CPU总核心数. –worker_processes8; –#全局错误日志定义类型,[ debu ...

  7. redis.conf 具体配置详解

    redis.conf 具体配置详解 # redis 配置文件示例 # 当你需要为某个配置项指定内存大小的时候,必须要带上单位, # 通常的格式就是 1k 5gb 4m 等酱紫: # # 1k => ...

  8. Apache 中httpd.conf文件配置详解(转载)

    httpd.conf文件配置详解   Apache的基本设置主要交由httpd.conf来设定管理,我们要修改Apache的相关设定,主要还是通过修改httpd.cong来实现.下面让我们来看看htt ...

  9. linux Apache CGI 安装配置

    Apache 中的提交了一种利用扩展应用程序执行动态网页的机制. 称为Common Gateway Interface (通用网关接口)简称CGI. 本文假定已安装好linux(本文的linux版本为 ...

随机推荐

  1. malloc函数详解 glibc2.27

    malloc 函数分析(glibc.2.27) 本人菜一只,如果分析的有错误,请大佬指正. __libc_malloc函数分析 void * __libc_malloc (size_t bytes) ...

  2. C语言-字符串函数的实现(二)之strcpy

    C语言中的字符串函数有如下这些 获取字符串长度 strlen 长度不受限制的字符串函数 strcpy strcat strcmp 长度受限制的字符串函数 strncpy strncat strncmp ...

  3. Innodb中的快照读和当前读

    一.前言 上篇文章记录了对MVCC的相关理解,其中有提到快照读.其实在MVCC并发控制中,读操作可以分为两类:快照读(snapshot read)和当前读(current read)   二.什么是快 ...

  4. 【Springboot项目启动异常】项目启动,数据库连接异常

    今天使用Springboot 整合 MybatisPlus 准备写一个Demo,在项目启动时,频繁出错,在此记录整个问题的解决过程 问题如下图 人工翻译一遍,主要意思就是没有检测到数据库驱动,也就是说 ...

  5. 病毒木马查杀实战第012篇:QQ盗号木马之逆向分析

    前言 在本系列的文章中,对每一个病毒分析的最后一个部分,若无特殊情况,我都会采用逆向分析的手段来为读者彻底剖析目标病毒.但是之前的"熊猫烧香"病毒,我用了三篇文章的篇幅(每篇250 ...

  6. Python模块化编程

    目录 模块化 自定义模块 模块的内置属性 导入模块 安装第三方模块 查看模块的属性和方法 模块化 在Python中,一个.py文件就称之为一个模块(Module),为了避免模块名冲突,Python又引 ...

  7. 路由协议之RIP

    目录 RIP协议 RIP的路由汇总和过滤 RIP的认证 RIP的防环机制 华为/思科中的配置 RIP协议 RIP协议是一种内部网关协议(IGP),底层是贝尔曼福特算法,是一种动态路由选择协议,用于自治 ...

  8. Python爬虫 XPath语法和lxml模块

    XPath语法和lxml模块 什么是XPath? xpath(XML Path Language)是一门在XML和HTML文档中查找信息的语言,可用来在XML和HTML文档中对元素和属性进行遍历. X ...

  9. Docker用Dockerfile定制镜像

    用Dockerfile定制镜像 镜像的定制实际上就是定制每一层所添加的配置.文件.如果我们可以把每一层修改.安装.构建.操作的命令都写入一个脚本,用这个脚本来构建.定制镜像,那之前提示的无法重复的问题 ...

  10. Docker用Commit给容器做快照

    关于 commit 镜像是容器的基础,每次执行 docker run 的时候都会指定哪个镜像作为容器运行的基础. 镜像是多层存储,每一层是在前一层的基础上进行修改:而容器同样也是多层存储,是在以镜像为 ...