crontab -e
命令,提示如下错误。
1 2 3 4 | [root @iZ *****kZ ~]# crontab -e crontab: installing new crontab /var/spool/cron/tmp.XXXX6bK9dR: Permission denied crontab: edits left in /tmp/crontab.ssXqpW |
/var/spool/cron/
目录无法写入。
目录被设置为不能被删除、改名、设定链接关系,同时不能写入或新增内容。
/var/spool/cron/
目录。
1 | cd /var/spool/cron/ |
1 | touch test |
1 | touch: cannot touch `test': Permission denied |
1 | lsattr cron/ |
1 2 3 | ----i--------e- cron/authorized_keys ----i--------e- cron/crontabs ----i--------e- cron/root |
注:“i”属性设定文件不能被删除、改名、设定链接关系,同时不能写入或新增内容。
1 | chattr -i cron/ |
crontab -e
命令,系统显示类似如下。
1 2 3 4 5 | [root @iZ ****kZ cron]# crontab -e crontab: installing new crontab crontab: error renaming /var/spool/cron/tmp.XXXXwhWDUP to /var/spool/cron/root rename: Operation not permitted crontab: edits left in /tmp/crontab.5f279w |
1 | chattr -i cron/root |
crontab -e
命令,系统显示类似如下,表示恢复正常。
1 | crontab: installing new crontab |