Linux Access.conf安全配置
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/24
或10.0.0.0-255
与10.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
翻译自: https://www.poftut.com/access-conf-security-configuration-linux-unix/
Linux Access.conf安全配置的更多相关文章
- VMware Linux 下 Nginx 安装配置 - nginx.conf 配置 [负载两个 Tomcat] (三)
首先启动Nginx 1. 相关浏览 两个 Tomcat 配置: VMware Linux 下 Nginx 安装配置 - Tomcat 配置 (二) Nginx 安装配置启动: VMware Linu ...
- linux limits.conf 配置
转自:http://kerry.blog.51cto.com/172631/300784 limits.conf 文件实际是 Linux PAM(插入式认证模块,Pluggable Authentic ...
- Linux 桌面系统字体配置要略
字体显示效果测试 这一段是为了测试宋体字的显示效果,包括宋体里面自带的英文字体,“This is english,how does it look like?”.这一行是小字.后面几个字是加粗的宋体. ...
- Linux 桌面玩家指南:04. Linux 桌面系统字体配置要略
特别说明:要在我的随笔后写评论的小伙伴们请注意了,我的博客开启了 MathJax 数学公式支持,MathJax 使用$标记数学公式的开始和结束.如果某条评论中出现了两个$,MathJax 会将两个$之 ...
- Linux 各类设置、配置、使用技巧参考,Linux使用集锦
========== 参考格式 (新增记录时,复制粘贴在下)============= [日期]: <标题> 参考链接ref1: 参考链接ref2: 正文: ========== 参考格式 ...
- 3-nginx.conf参数配置
–#定义Nginx运行的用户和用户组 –user www www; –#nginx进程数,建议设置为等于CPU总核心数. –worker_processes8; –#全局错误日志定义类型,[ debu ...
- redis.conf 具体配置详解
redis.conf 具体配置详解 # redis 配置文件示例 # 当你需要为某个配置项指定内存大小的时候,必须要带上单位, # 通常的格式就是 1k 5gb 4m 等酱紫: # # 1k => ...
- Apache 中httpd.conf文件配置详解(转载)
httpd.conf文件配置详解 Apache的基本设置主要交由httpd.conf来设定管理,我们要修改Apache的相关设定,主要还是通过修改httpd.cong来实现.下面让我们来看看htt ...
- linux Apache CGI 安装配置
Apache 中的提交了一种利用扩展应用程序执行动态网页的机制. 称为Common Gateway Interface (通用网关接口)简称CGI. 本文假定已安装好linux(本文的linux版本为 ...
随机推荐
- 【Redis破障之路】二:Redis安装和基本数据结构
1.安装Redis Redis6.0在2020年已经发布,所以我们安装Redis3.0. 1.1.在Linux上安装Redis 我们在CentOS上安装Redis.常见的的有三种安装方式: yum/a ...
- JAVAEE_Servlet_22_Cookie实现十天内免登录
Cookie实现十天内免登录 代码: - CheckLogin 查看是否获取到了Cookie,如果获取到了连接数据库验证Cookie发过来的用户名和密码,如果没有获取到Cookie信息,那么就跳转到登 ...
- HTTP 基础(特性、请求方法、状态码、字段)
1. HTTP 简介(含义.特性.缺点) 2. HTTP 报文 3. GET 和 POST 4. 状态码 5. HTTP 头字段 1. HTTP 简介 HTTP 的含义 HTTP (HyperText ...
- 这一篇文章帮你搞定Java(含Java全套资源)
当下想学习Java开发的人越来越多,对于很多零基础的人来说,没有相关的视频教程及相关的学习线路,学起来是一件很费劲的事情,还有很多人从网上及其它渠道购买视频,这些视频资料的价格对于刚毕业的大学生来说也 ...
- 技术分享|SQL和 NoSQL数据库之间的差异:MySQL(VS)MongoDB
在当今市场上,存在各种类型的数据库,选择适合你业务类型的数据库对应用的开发和维护有着重要意义.本篇文章,将为大家分享SQL和NoSQL语言之间的区别,同时还将比较这两种类型的数据库,以帮助小伙伴们选择 ...
- Python socket(TCP阻塞模式)基础程式
前置知识:Python基础语法,socket库 tips: 1. 默认HOST_IP:127.0.0.1 2. 默认HOST_PORT:7676 参考代码: 1. 客户端程式 #!/usr/bin/e ...
- Hexo 博客Next 搭建与美化主题
========================================================================================将页面部署到GitHub ...
- Intel汇编程序设计-整数算术指令(中)
7.3 移位和循环移位的应用 7.3.1 多双字移位 要对扩展精度整数(长整数)进行移位操作,可把它划分为字节数组.字数组或双字数组,然后再对该数组进行移位操作.在内存中存储数字时通常采用的方式是 ...
- [CTF]培根密码
[CTF]培根密码 --------------------- 作者:adversity` 来源:CSDN 原文:https://blog.csdn.net/qq_40836553/articl ...
- scrapy爬虫案例--爬取阳关热线问政平台
阳光热线问政平台:http://wz.sun0769.com/political/index/politicsNewest?id=1&page=1 爬取最新问政帖子的编号.投诉标题.投诉内容以 ...