[root@localhost ~]# chmod 644 /var/log/messages
chmod: changing permissions of ‘/var/log/messages’: Operation not permitted
[root@localhost ~]# journalctl -xe
Feb 18 18:31:26 localhost.localdomain rsyslogd[1267]: file '/var/log/secure': open error: Permission denied [v8.24.0-57.el7_9.1 try http://www.rsyslog.com/e/2433 ]
Feb 18 18:31:26 localhost.localdomain rsyslogd[1267]: action 'action 1' resumed (module 'builtin:omfile') [v8.24.0-57.el7_9.1 try http://www.rsyslog.com/e/2359 ]
Feb 18 18:31:26 localhost.localdomain rsyslogd[1267]: file '/var/log/secure': open error: Permission denied [v8.24.0-57.el7_9.1 try http://www.rsyslog.com/e/2433 ]
Feb 18 18:31:26 localhost.localdomain systemd[8488]: Failed to chown socket at step GROUP: No such process
[root@localhost ~]# echo "" >> /var/log/messages
-bash: /var/log/messages: Permission denied
[root@localhost ~]# chattr -i /var/log/messages
[root@localhost ~]# lsattr -a /var/log/messages
---------------- /var/log/messages
[root@localhost ~]# echo "" >> /var/log/messages
[root@localhost ~]# stat /var/log/messages
File: ‘/var/log/messages’
Size: 342 Blocks: 8 IO Block: 4096 regular file
Device: fd00h/64768d Inode: 33849780 Links: 1
Access: (0600/-rw-------) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2022-02-18 18:27:18.222968086 +0800
Modify: 2022-02-18 18:35:04.462971928 +0800
Change: 2022-