Sunday, October 30, 2022

[SOLVED] Unable to change permission of a file in linux

Issue

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. href="https://i.stack.imgur.com/GjB2Z.jpg" rel="nofollow noreferrer">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!



Answered By - BishwashK
Answer Checked By - Mary Flores (WPSolving Volunteer)