HostOnNet Blog

root can’t change file permission

Looking for Linux Server Admin or WordPress Expert? We can help.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.