Differences between WindowsNT and Linux file permissions
Source: Internet
Author: User
Article title: WindowsNT differs from Linux in terms of file permissions. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
First, let's talk about Windows. for WindowsNT, as long as you set a security attribute that cannot be written by everyone to a file (that is, file permission ), no matter which folder it is in, it cannot be deleted, regardless of its security attribute.
When you get used to the security attribute settings of Windows, the idea is that whether a file can be deleted depends on the security attribute of the file. I already have this concept.
Then let's look at the increasing number of Linux systems. I use RedHat and red-flag Linux, and should be the same for other Linux systems.
If there is a directory in Linux that is assumed to be share (permission drwxrwxrwx, that is, anyone has full control), there is a file named amtr below. suppose this file is a message that a user has written to root, he does not want others to see the content of the file, so he sets the amtr permission to-rw -------, this should be the case-if another user executes cat amtr in the share directory, it will display Permission denied (no Permission ).
However, if another user executes rm amtr in the share Directory, what are the results -- amtr is missing. Worse, other users can change their names at will. For example, run the mv amtr rootTMD command.
The reason is that Linux handed over all the file I-nod information to directory management. Including information such as the file does not exist, the file name is what, and where the file is stored on the disk. As long as you have the write permission for this directory, you can delete any file in the Directory (note: the file here does not include the directory) and change the file name of any file in the Directory (note: including directories ).
In particular, for a directory, if your Directory is just an empty directory, it is equivalent to a file and can be completely deleted. However, Linux cannot Delete a non-empty directory. As long as you do not have the permission to write files in your Directory and there are files in the directory that others do not have the permission to write, you cannot delete your Directory (execute "rm-r directory name" instead of truncating the directory from the current directory, instead, recursively deleting the directory content one by one, so you cannot delete it ), you can change the name at most.
You can see that the/tmp permission is drwxrwxrwt. t means that only the creator can modify the permission. I thought the reason for this was not to allow others to delete the tmp directory, the reason for setting this directory to o + t is that you are not allowed to delete other things that are not deleted but under this directory.
In Linux, be careful not to put your important files in a directory fully controlled by anyone. Even if the permission for this file is 0.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service