Linux basic command exercises Day2 and linux exercises day2

Source: Internet
Author: User

Linux basic command exercises Day2 and linux exercises day2

Job 1:

1) create a user named natasha. The uid is 1000, the gid is 555, and the remarks are "master"

2) modify the Home Directory of the natasha user to/Natasha

3) view the last line of the user information configuration file

4) set the password "123" for natasha users"

5) view the last line of the User Password Configuration File

6) Lock the natasha User Account

7) unlock the natasha User Account

8) create a group police with the gid of 999

9) view the last row of the group configuration file

10) add natasha users to the police Group

11) modify the group name of the police group to jingcha.

12) Delete the natasha user, and delete the home directory and email address together.

13) Delete the jingcha Group

 

Assignment 2:

1) Create the directory test in the user's home directory and enter test to create an empty file file1

2) display the file information in long format. Pay attention to the permissions and users and groups of the file.

3) Set permissions for file file1 so that other users can write the file.

4) view the setting result,

5) cancel the permission of users in the same group to read file1 and view the setting result.

6) set the permission for the file in digital notation. The owner can read, write, and execute the file. The owner and other users in the group can only read and execute the file. After the setting is complete, view the setting result.

7) change the file1 permission in number format so that the owner can only read the file. No other user has permission. View the setting result.

8) return to the upper-level directory to view test permissions.

9) add write permission for this directory to other users

Job 3:

Create a user, alex, as a file Operator

 

Job 4:

1) Create the/test/dir directory. The owner is tom, the array is group1, And the/test directory has 777 permissions.

2) create a new user jack, switch to the user jack, and verify the rwx permission of the user jack on the dir directory (enable another terminal and modify the others permission of the dir directory in turn)

3) Add jack to group1 to verify the rwx permission of the dir directory of jack (enable another terminal and modify the group permission of the dir directory in sequence)

4) switch to the tom user and verify the rwx permission of the tom user on the dir directory (enable another terminal and modify the user permission of the dir directory in turn)

 

5. Create a new file tom.txt in the dirdirectory. The owner is tom, the group is group1, And the/test directory has the permission of 777.

 

The others permission of Alibaba to cooperate with the verification process)

 

The group1 permission of worker works with the verification process)

 

Switch 8 to the Tom user, verify that the Tom user has the rwxpermission limit for tom.txt(enable and enable another user, and modify the user permission of tom.txt to cooperate with the verification process)

 

 

References

1. http://www.cnblogs.com/linhaifeng/articles/6045600.html#_label6

2. http://www.linuxidc.com/Linux/2016-03/129089p4.htm

3. http://cn.linux.vbird.org/linux_basic/0410accountmanager.php#account_id

 

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.