In Linux system operation, in order to prevent files from being changed, you can protect the files with permissions. How do you do this? The following small series will introduce you to the method of protecting the rights of files under Linux. Let's learn together.
In the process of managing Linux systems for some important key files, configuration files, and important personal information, users often do not want arbitrary changes, this time we need the file To protect the permissions to prevent tampering with the file, we can change the file's properties to 600.
Permission protection is set to 600 permissions
For example:
[root@localhost /]# chmod 600 /usr/local/webserver/nginx/conf/nginx.conf< Br>
So we set the /usr/local/webserver/nginx/conf/nginx.conf file to 600 permissions to prevent modification.
Using the <quo;chattr” command
In addition, if Linux is using ext2, ext3 or ext4 filesystems, you can also use the <quo;chattr” command:
code below :
Usage: chattr [-RVf] [-+=AacDdeijsSu] [-v version] files. .
Use the i attribute
to add i attributes to important files, even if the root user can not directly modify or delete such files, in order to effectively prevent accidental modification or deletion of files. The specific commands are as follows:
The code is as follows:
# chattr +i passwd
Add the attribute of i to the passwd file
Remove the i attribute using the following command :
The code is as follows:
# chattr –i passwd
Remove the properties of the passwd file i and modify the file.
The above is the way to protect the permissions of files under Linux. If some of your files are important, it is best to protect them. Otherwise, it will be troublesome.
The Fedora 22 version was released in May of this year. A lot of new features have
JDK8 is a product of Java. If you remember that the format of the previous mobile software installat
In the Linux system, the top command can be used to monitor the status of the process, or to modify
Linux libgdiplus is a Mone library that can be used to display the color of web pages. However, many
Linux uses node.js to execute commands.
Differences between Linux system MBR and GPT partitions
How Linux Expands Disks under VMware
Introduction to Common Disk Arrays for Linux Systems
How to remotely connect to the Linux system desktop via VNC
Linux steps to send mail through the command line
How to view information about Linux loading built-in modules
Linux which command to find files using
Ubuntu installs the game Wesnoth step
Kali Linux installation Google Chrome common problems and solutions
How Linux uses shell scripts to defend against small amounts of ddos attacks
Sogou wallpaper unloading graphic tutorial
How to solve the Win7 system DNS server does not respond?
How to maximize the Win8 look at the total rendering method
Feel free to change the WIN7 theme Personalized desktop icon never changes
How to set .NET pseudo-static in windows2003 IIS6 environment
Win10 Spartan browser commonly used features graphic explanation