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.

Related posts:

  1. qmail and root email forwarding
  2. FreeBSD Log File Rotation with NewSysLog
  3. FreeBSD Allow Root Login
  4. File system Security
  5. Change Hostname of FreeBSD Server
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>