WebApr 26, 2004 · First, you need to login as root user. Only root user can set and remove immutable flag on a file. The syntax is: chattr +i file chattr +i / path / to / filename. Type the following command to write protect /etc/shadow file on a Linux: # chattr +i /etc/shadow. Now, login as the normal user (say vivek) and type the passwd command to change … WebThe details you want are in the manual page for the chmod () system call. Instead of man chmod use man 2 chmod. man chattr and man 2 setxattr will interest you as well; the file attributes that chattr/setxattr () set augment the behavior of the traditional Unix permissions set by chmod. Share Improve this answer Follow answered Oct 22, 2012 at 4:37
What
Webchattr is the command in Linux that allows a user to set certain attributes of a file. lsattr is the command that displays the attributes of a file. Most BSD-like systems , including macOS , have always had an analogous chflags command to set the attributes, but no command specifically meant to display them; specific options to the ls command ... Webchattr is the command in Linux that allows a user to set certain attributes of a file. lsattr is the command that displays the attributes of a file. Most BSD-like systems , including … nanny overseas
Linux Chattr and Lsattr Command Help and Examples - Computer …
WebJul 29, 2011 · 1 Answer Sorted by: 25 you can use wildcards, like chmod a+rwx *.txt or find -type f -exec chmod a+rwx {} \; the last command will find all files and exec the chmod per each file. however, having a+rwx is not recommended at all Share Improve this answer Follow answered Jul 29, 2011 at 14:26 marcelog 7,002 1 32 46 Add a comment WebJan 17, 2024 · Method 1: I am going to write protect your /etc/resolv.conf file using the chattr command on a Linux bases system. The syntax is: # chattr +i /etc/resolv.conf The +i option (attribute) write protects /etc/resolv.conf file on Linux so that no one can modify it including root user. You can use chflags command on FreeBSD based system. Web2. The details you want are in the manual page for the chmod () system call. Instead of man chmod use man 2 chmod. man chattr and man 2 setxattr will interest you as well; the … meg white sighting