The files created by each user can be modified and viewed by each user, but only roo
Knowledge reserve:
Special permissions:
SUID: when running a program, the owner of the corresponding process is the owner of the program file itself, not the initiator; (it is often used when ordinary users have administrator privileges to execute certain commands, which is very dangerous)
Chmod Utility FILE
Chmod Umurs FILE
If FILE itself already has execute permission, SUID is displayed as s; otherwise, S is displayed.
SGID: when running a program, the subordinate group of the corresponding process is the subordinate group of the program file itself, not the basic group to which the initiator belongs.
Chmod gears FILE
Chmod Gmurs FILE
Sticky: in a public directory, everyone can create files and delete their own files, but cannot delete other people's files
Chmod ostent DIR
Chmod Omurt DIR
Of course, you can also modify permissions in digital form, such as chmod 5755 / backup/test
Experiment:
Practice:
1. Create the members of the development team: hadoop, hbase, hive, and set the password for them:
# useradd hadoop
# passwd hadoop
# useradd hbase
# passwd hbase
# useradd hive
# passwd hive
two。 Create a public directory / tmp/project and development group developteam, and change the subordinate group of the directory to this development group:
# mkdir / tmp/project
# groupadd developteam
# chown-R: developteam / tmp/project/
3. Change the additional group for three users to developteam:
# usermod-a-G developteam hadoop
# usermod-a-G developteam hbase
# usermod-a-G developteam hive
4. Grant write permission to the directory / tmp/project/ and add SGID,Sticky:
# chmod Grouw / tmp/project/
# chmod gears / tmp/project/
# chmod otakt / tmp/project/
# ls-ld / tmp/project/
Drwxrwsr-t. 2 root developteam 21 August 2 19:46 / tmp/project/
5. Create a file under the hbase user and see that it belongs to a group, and test it for deletion and modification with another user:
# su-hbase
$cd / tmp/project/
$touch b.hbase
$ll
-rw-rw-r--. 1 hbase developteam 0 August 2 19:56 b.hbase
6. At this point, the configuration is complete, and as long as the files created by the three users themselves under / tmp/project, they can view and modify them at will, but only the file creator and root users can delete the files.