root can’t change file permission

On RHEL 3 Plesk server, i tried to edit file

/root/.bashrc

But i can’t edit it. vi editor says, file is ready only and use w! to write, but that also not worked. So i exited vi, tried changing permission of the file.

# whoami
root
# ls -l .bashrc
-rw-r–r– 1 root root 176 Aug 23 1995
.bashrc
# chmod 744 .bashrc
chmod: changing permissions of `.bashrc’:
Operation not permitted
#

On chmod, i get Operation not permitted error.

So i checked extended file permission with

# lsattr /root/.bashrc

It is found the file with i (IMMUTABLE) bit set.

# lsattr /root/.bashrc
—-i——– /root/.bashrc
#

This is removed by the command

# chattr -i /root/.bashrc

Now the file is editable.


Posted in Uncategorized. Bookmark the permalink.