banner
xingli

xingli

猫娘爱好者

Modifying file permissions in Linux is called "Operation not permitted".

Reason: Files with the i attribute cannot be modified.

  1. First, when executing chmod 777 /etc/sysctl.conf, an error will be thrown: chmod: changing permissions of '/etc/sysctl.conf': Operation not permitted.

image
2. Then, execute the command lsattr /etc/sysctl.conff to see the current file's attributes.

image
3. It can be observed that the current file has the i attribute. By referring to the command's help documentation, it can be seen that files with the i attribute cannot be modified or even deleted, even by the root user.

image
4. Therefore, the corresponding solution is to remove the i attribute from the file. Remove the i attribute: chattr -i /etc/sysctl.conf.

image
5. Then, the content of this file can be modified. At this point, the file can be deleted and written to using rm.

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.