当前位置:网站首页>2022.07.02

2022.07.02

2022-07-07 19:16:00 ifuudoudou

Class hour 10 Review and learning objectives

 

 

  Class hour 11 user , User groups and rights management

 

In the use of su root At first, I failed , Because there is no initialization root.

So you need to input sudo passwd root, To initialize the , To succeed .

 

After entering the root directory , It can be used whoami This command checks the current login account .

When creating a new user , At first I used “add user” The result is an error saying that there is no such order .

Later I read this document Linux How to manually create a new user (How to create new users manually under Linux) - Douding net , Only to find that there is no space in the middle , yes “adduser”.

 

You should also pay attention to when viewing the newly created user information ,cat /etc/passwd This catalogue contains cotton ,cat There must be a space after .

 

The information of the newly created user is at the bottom .

Class hour 12

 

Switch back to the home, Reuse ll Check the information in the file , You can find that there is no user directory just created .

in other words , The user was not created successfully .

 

Because we didn't add details just now .

Now we use -m To create , And then reuse it cat /etc/passwd Check it out. , It can be seen that there are already . 

 

 

Then we use password To set the password of new users .

Use after setting su test02 To switch .

 

  use whoami Check it out. , I found that I did switch to test02.

If you want to go back to the original directory , utilize crtl+d You can quit .

 

If you want to switch users at the same time , Switch to the added directory .

stay su Add a horizontal line in front of it .

 

Use when deleting userdel test02.

  But the added directory will not be deleted .

Delete the added directory by recursion .

 

Then a new one is established according to the above method test03, Reuse userdel -r test03 To delete .

In this way, even the added directory can be deleted .

Although the report is wrong , But it doesn't affect .

 

原网站

版权声明
本文为[ifuudoudou]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/188/202207071701291525.html