当前位置:网站首页>2022.07.02
2022.07.02
2022-07-07 17:01:00 【ifuudoudou】
课时10 回顾和学习目标


课时11用户,用户组和权限管理


在使用su root的时候一开始我失败了,因为没有初始化root。
所以需要输入sudo passwd root,来初始化,才能成功。

进入根目录后,可以用whoami这个命令查看当前登陆的账号。

创建新用户时,一开始我是用的“add user”结果报错说没有这个命令。
后来看了这个文档Linux下如何手动创建新的用户(How to create new users manually under Linux) - 豆丁网,才发现中间没有空格,是“adduser”。

查看新创建用户信息时也要注意,cat /etc/passwd这个目录里棉,cat后面必须有空格。
刚刚创建好的用户的信息就在最下面。
课时12
切换回home,再用ll查看文件里面的信息,可以发现没有刚才创建的用户目录。
也就是说,用户并没有创建成功。

因为刚才我们并没有添加详细信息。
![]()
现在我们使用了-m来创建,然后再利用cat /etc/passwd来查看,可以看见已经有了。

接着我们利用password 来设定新用户的密码。
设定之后利用su test02来切换。
用whoami来查看,发现现在确实切换到了test02.

想要回去原来的目录的话,利用crtl+d就可以退出了。

如果想要在切换用户的同时,切换到加的目录下面的话。
在su 前面加一个横线就可以。
![]()
删除时利用userdel test02.
但是增加的目录是不会删除的。
![]()
删除增加的目录要用递归删除。
接着重新按照上面的方法建立了一个test03,再用userdel -r test03的方法来删除。
这样的话连添加的目录也可以删除。
虽然报错了,但是不影响。
边栏推荐
- 标准ACL与扩展ACL
- Mathematical analysis_ Notes_ Chapter 11: Fourier series
- SQLite SQL exception near "with": syntax error
- Embedded interview questions (algorithm part)
- 【软件测试】从企业版BOSS直聘,看求职简历,你没被面上是有原因的
- NAT地址转换
- ip netns 命令(备忘)
- How many times is PTA 1101 B than a
- Complete e-commerce system
- 【剑指 Offer】59 - I. 滑动窗口的最大值
猜你喜欢

Five network IO models

Continuous test (CT) practical experience sharing
![Kirk borne's selection of learning resources this week [click the title to download directly]](/img/df/98aa3edf0a70b870684963d52e7c72.png)
Kirk borne's selection of learning resources this week [click the title to download directly]

嵌入式C语言程序调试和宏使用的技巧
![[tpm2.0 principle and Application guide] Chapter 9, 10 and 11](/img/7f/0d4d91142bc3d79ea445a8f64afba7.png)
[tpm2.0 principle and Application guide] Chapter 9, 10 and 11

Mathematical analysis_ Notes_ Chapter 11: Fourier series

Charles+drony的APP抓包

The highest level of anonymity in C language

10 schemes to ensure interface data security

RISCV64
随机推荐
Flipping Game(枚举)
3. About cookies
UVALive – 4621 Cav 贪心 + 分析「建议收藏」
高温火烧浑不怕,钟薛高想留清白在人间
Reject policy of thread pool
Wechat web debugging 8.0.19 replace the X5 kernel with xweb, so the X5 debugging method can no longer be used. Now there is a solution
【软件测试】从企业版BOSS直聘,看求职简历,你没被面上是有原因的
ip netns 命令(备忘)
Redis cluster and expansion
面试唯品会实习测试岗、抖音实习测试岗【真实投稿】
Recommend free online SMS receiving platform in 2022 (domestic and foreign)
[Blue Bridge Cup training 100 questions] sort scratch from small to large. Blue Bridge Cup scratch competition special prediction programming question centralized training simulation exercise question
前首富,沉迷种田
What is the general yield of financial products in 2022?
体总:安全有序恢复线下体育赛事,力争做到国内赛事应办尽办
6.关于jwt
LeetCode 497(C#)
Nat address translation
手把手教姐姐写消息队列
【剑指 Offer】59 - I. 滑动窗口的最大值