如何解决s权限位引起postfix及crontab异常

1、问题现象html

业务反馈某台应用服务器,普通用户使用mutt程序发送邮件时,提示“postdrop warning: mail_queue_enter: create file maildrop/713410.6065: Permission denied”,并且普通用法使用crontab -e 编辑自身任务计划时,也会提示“ crontab: edits left in /tmp/crontab.XXXXCl0bLz” 。linux

2、问题分析与解决服务器

一、postdrop异常问题post

如何解决s权限位引起postfix及crontab异常如何解决s权限位引起postfix及crontab异常

使用postfix check命令检测发现有以下报错:this

postfix/postfix-script: warning: not set-gid or not owner+group+world executable: /usr/sbin/postqueue
postfix/postfix-script: warning: not set-gid or not owner+group+world executable: /usr/sbin/postdrop

上面的提示其实已经很是清楚了,在这两个可执行文件的组权限中,没有s权限位。慎重起见,不审找了一台主机对比下,发现确实不存在s权限,正常的权限以下:rest

# ll /usr/sbin/postqueue
-rwxr-sr-x. 1 root postdrop 259992 Jan 27 2014 /usr/sbin/postqueue

解决方法很是简单:orm

chmod g+s /usr/sbin/postqueue
chmod g+s /usr/sbin/postdrop
postfix reload

二、crontab普通用户没法编辑问题htm

使用crontab -e发现能够正常查看,可是编辑完,保存时提示“ crontab: edits left in /tmp/crontab.XXXXCl0bLz” 。即然上面第一个问题是s权限位引发的,这个问题想必也是,因此未作strace 或审计跟踪,地接查看/usr/bin/crontab权限位,发现和正常主机对比,发现用户权限上少了s权限 ---crontab命令和passwd命令相似,须要用户具备s权限位。执行以下命令后,问题解决:blog

chmod u+s /usr/bin/crontab
rccron restart

注:这点对比了下SuSE和redhat下的区别,发现user权限下若是没有s权限位。在redhat下提示:crontab

  1. You (test) are not allowed to use this program (crontab)
  2. See crontab(1) for more information

并且直接crontab -l命令查看时,都会提示上面的错误。而在SuSE没有这个s权限,仍然能够正常的经过crontab -l 进行查看。

原文来自:https://www.linuxprobe.com/s-postfix-crontab.html

相关文章
相关标签/搜索