In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces the method of Unix / Linux configuration file and directory access, which can be used for reference by friends who need it. I hope you will learn a lot after reading this article. Next, let the editor take you to learn about it.
The Unix and Linux operating systems assign one of the three access types (read, write, and execute) to each of the three groups (owner, group, and other users) to set access to files and directories.
How do I view file and directory access?
We can use the ls command with the-l option to list the details of the file properties, such as
Ls-l filename
The above command returns information like-rwe-rw-r, indicating that the file has read, write, and execute permissions for the owner, read and write permissions for the group, and read-only permissions for all other users.
Each type of access has the associated values listed below:
Read = 4
Write = 2
Execute = 1
How do I configure file and directory access?
You can use the chmod command to assign access to files and directories.
When we add up the access values for each of the above groups, we get a value between 0 and 7, which can be used to assign or modify permissions using the chmod (change Mode) command.
You can specify access to related files by entering the following command, such as-rwe-rw-r-like information returned in the above example
Chmod 764 filename
The number 764 comes from:
Rwe = 4 (r) + 2 (w) + 1 (e) = 7
Rw = 4 (r) + 2 (w) = 6
R = 4 (r) = 4
Note: the UNIX/Linux command and object name are case sensitive and must use "chmod" instead of CHMod or any other combination of uppercase and lowercase letters.
Example of using the chmod command:
Everyone can access it, and you need to run the following command:
Chmod 777 filename
Set full access to owner and group permissions, but other user settings can only be read and executed:
Chmod 775 filename
Full access to the owner, but restrict groups and other user permissions to read and execute only files in the directory:
Chmod 755 dirname
Full access to the owner, no access or permission to anyone else:
Chmod 700 filename
Unable to access groups or other users in the directory and owners to restrict read and execute permissions to prevent accidental deletion or modification of files in the directory:
Chmod 500 dirname
Allows owners and groups to have read and write access to files, and allows others in the group to edit or delete files and owners, but cannot access other users:
Chmod 660filename thank you for reading this article carefully, hope that the editor to share Unix / Linux configuration files and directory access method content is helpful to everyone, but also hope that you support a lot, pay attention to the industry information channel, find problems, detailed solutions waiting for you to learn!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.