Search code examples
linuxpermissionsimmutability

Unable to change permission of a file in linux


I tried to remove the immutable permission of hosts file with "sudo chattr -i /etc/hosts" command but it is not changing. Can anyone please help me with this. enter image description here

I tried to forcefully write the file with :wq! In vim still the file is not changed


Solution

  • I think, you can solve this problem using:

    sudo chattr -ai /etc/hosts
    

    Hope this helps!