Can’t edit /etc/resolv.conf with root account problem.

  • A file is set with ‘i‘ attribute, cannot be modified (immutable). Means no renaming, no symbolic link creation, no execution, no writable, only superuser can unset the attribute.
  •  we use the + sign and to unset use the – sign with the chattr command.
    + : Adds the attribute to the existing attribute of the files.
    – : Removes the attribute to the existing attribute of the files.
    = : Keep the existing attributes that the files have.
vi /etc/resolv.conf 
/etc/resolv.conf" [readonly] 12L, 301C 
[root@rhel6 ~]# lsattr /etc/resolv.conf
----i--------e- /etc/resolv.conf
[root@rhel6 ~]# chattr -i /etc/resolv.conf
[root@rhel6 ~]# lsattr /etc/resolv.conf
-------------e- /etc/resolv.conf
[root@rhel6 ~]# vi /etc/resolv.conf
Advertisements

Welcome to Blog,

This blog was created to share my experiences to help other people. On this page you can find an information about Linux/Unix (Redhat, HP-UX, OEL, Debian …etc.), backup, storage and troubleshooting topics.