Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the specific permissions of the Linux directory

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

What are the specific permissions of the Linux directory? I believe many inexperienced people are at a loss about this. Therefore, this article summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

The read limit of the directory means that the contents of the directory can be listed. Writing permission bits means that files can be created in that directory, and executing permission bits means searching for and accessing the directory (cd).

Rmure-permission: you cannot execute the ls command if you have read permission alone. Ls dir needs to have the rmerx permission of this dir at the same time.

-W-permission: nothing can be done only with write permission. You must have-wx permission to create a file.

-- X permission: you can enter this directory only if you have x permission, and you can cd dir

If you have read access to a file, you can ls dir/xfile,cat dir/xfile.

If you have write access to a file, you can vi dir/xfile it (when you don't have read permission) and then you can save it as an overwrite.

If you have execute permission on a file, you can dir/xfile execute the file.

Suppose there is a file file under dir, and the permission of a user to the file of file is rwx and dir is-- x, then the user can use the path. / dir/file executes the file file and edits it through vi because the directory is accessible.

However, the user cannot ls after cd the directory, but it can ls dir/file.

Suppose there is a file file under dir, and the permission of a user to the file of file is rwx, and dir is rw-, then the user cannot go through the path. / dir/file executes the file file, which cannot be edited through vi because the directory is inaccessible (cannot be entered by cd). At the same time, you cannot create new files in this directory, although you already seem to have w permissions.

If a user has rwx permission for the folder / AA/BB/CC, if you want to operate the CC folder properly, you must have x permission for both AA and BB.

Therefore, the directory pair combination of other users is generally set to rmurx.

For a file, if you want the x permission of a file to work, you must also have r permission.

The danger of giving w permissions to other users for directories: in directories owned by user Locke. There is a file called twotreatiesOnGrv under / treaties, and then Locke restricts this file to that other users cannot write, but other users have write permission to the treaties directory, so can others, for example, Plato also write twotreatiesOnGrv this file? the answer is, no but also can, Plato can not directly, such as vi to change this file (but w! TwotreatiesOnGrv can also overwrite this file), but he can overwrite the twotreatiesOnGrv from another file to the treaties directory through mv.

For files that do not have write permission, if you have write permission to the directory, the file can be deleted.

After reading the above, do you have any specific methods for Linux directory permissions? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report