Homework One
1, the new user Natasha,uid, GID is 555, the note information is "master"
Groupadd-g 555 Natasha
useradd-g 555-u 1000-c Master Natsha
Modify Natasha user's home directory to/natasha
View the last line of the user information profile
Set the password "123" for Natasha users
View the last line of a user's password profile
Lock the Natasha user account
Unlocking the Natasha user account
New group Police,gid to 9999
To view the last line of a group configuration file
Adding Natasha users to the police group
Modify the group name of the police group to Jingcha
Delete Natasha user, delete home directory and mailbox
Delete a Jingcha group
Homework Two
Create a directory test in the user's home directory, enter test to create an empty file File1
Display file information in long format, note the permissions of the file and the user and group to which it belongs
Set permissions for file File1 so that other users can write to this file
View Settings results
Remove Read permissions to file file1 for the same group of users and view set results
Set permissions for file files in numeric notation, all readable, writable, and executable, and the owning group user and other users have only read and execute permissions. View Setup results when Setup is complete
Change the permissions of the file file1 in numeric form so that the owner can only read the file. No other user has permission. View the settings results.
Go back to the upper directory to see the test permissions
Add write permissions to this directory for other users
Job Three
Create a new user by manipulating the file Alex
Job Four:
1) Create a new directory/test/dir, the owner is Tom, the array for the Group1,/test directory has permission of 777
2) New user jack, switch to the jack user, verify the jack user rwx permissions to the dir directory (open another terminal, and then modify the Dir directory's others permissions)
Remove Read permission
Remove Write permission
Remove Execute Permissions
3) Add Jack to the group1 group to verify the Jack User's rwx permissions to the dir directory (open another terminal, and then modify the group permissions of the Dir directory)
-[[email protected] test]# usermod–g group1 Jack
-[[email protected] test]# ID Jack1115
uid=1006 (Jack) gid=1114 (Jack) group =1114 (Jack), 1115 (group1)
4) switch to Tom User, verify the RWX permission of Tom user to dir directory (open another terminal, modify the user permission of Dir directory in turn)
Su Tom
Touch/test/dir/b.txt
Ls/test/dir
5) Create a new file in Dir directory Tom.txt, the owner is Tom, the group is the Group1,/test directory permissions for 777
-[[email protected] test] #chown tom.group1 tom.txt
-[[email protected] test] #chown 777 Tom.txt
-[[email protected] test] #ls-L tom.txt
-RWXRWXRWX 1 Tom group1-23:55 Tom.txt
6) New user rose, switch to Rose User, verify the Rose User's rwx permissions to Tom.txt (open another terminal, modify tom.txt others permissions to match the verification process)
-Useradd Rose
-Su Rose
Cat/test/dir/tom.txt
7) Add rose to the group1 group and, under the Rose user, verify the rwx permissions of the rose user to Tom.txt (open another terminal and modify Tom.txt group1 permissions to match the verification process)
Usermod-a-G group1 Rose
Su Rose
Cat/test/dir/tom.txt
8) switch to Tom User, verify Tom User's rwx permission to Tom.txt (open another terminal, modify Tom.txt user permission to cooperate with the verification process)
Su Tom
Less/test/dir/tom.txt
Linux Command permissions