at.allow与at.deny及cron.allow与cron.deny优先级的比较

您所在的位置:网站首页 deny的中文是什么 at.allow与at.deny及cron.allow与cron.deny优先级的比较

at.allow与at.deny及cron.allow与cron.deny优先级的比较

#at.allow与at.deny及cron.allow与cron.deny优先级的比较| 来源: 网络整理| 查看: 265

在默认情况下,任何用户都可以使用at服务,但这样是不安全的。为了不让主机被“黑”,就要使用/etc/at.allow和/etc/at.deny来进行管理限制。

/etc/at.allow 仅允许这个文件里列出的用户使用at /etc/at.deny 该文件列出的用户都不能使用at服务

at.allow与at.deny的优先级

1)查看文件

[root@zdk home]# cd /etc/ [root@zdk etc]# ls at* at.deny

系统默认情况下,只有at.deny

2)现在往at.deny里添加用户

[root@localhost etc]# cat /etc/at.deny

[root@localhost etc]# vim /etc/at.deny [root@localhost etc]# [root@localhost etc]# cat /etc/at.deny a b

3)切换用户执行at

[root@localhost etc]# su a [a@localhost etc]$ at 12:00 You do not have permission to use at. [a@localhost etc]$ 不允许使用at这个命令。

4)因为没有at.allow,所以先建立文件,之后添加用户,最后执行at。

[root@localhost ~]# vim /etc/at.allow [root@localhost ~]# cat /etc/at.allow a

[root@localhost ~]# at 12:00 at> shutdown -h now at> job 2 at 2012-12-25 12:00 [root@localhost ~]#  可执行at命令 5)添加用户为root时的情况

[root@zdk oracle]# vi /etc/at.deny [root@zdk oracle]# cat /etc/at.deny root [root@zdk oracle]# at 01:00 at>  可执行at命令 当at.allow 文件存在,列出的用户才被允许使用 at,并且 at.deny 文件会被忽略。

当只有at.deny 文件时,列出的用户是被禁止使用 at。

并且root帐户随时都可以执行at指令,即使这个帐户已经被列入了at.deny存取控制文件的黑名单。

综上所述:at.allow比at.deny的优先级高!

例题:              at.allow中有test用户              at.allow中没有test用户

at.deny中有test用户                   能                            不能

at.deny中没有test用户                能                          不能

 

                               cron.allow中有test用户             cron.allow中没有test用户

cron.deny中有test用户                  能                                      不能

cron.deny中没有test用户              能                                     不能

 



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3