当前位置:网站首页>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的方法来删除。
这样的话连添加的目录也可以删除。
虽然报错了,但是不影响。
边栏推荐
- 高考填志愿规则
- 2022-07-04 matlab reads video frames and saves them
- [demo] circular queue and conditional lock realize the communication between goroutines
- Multimodal point cloud fusion and visual location based on image and laser
- Reuse of data validation framework Apache bval
- Skills of embedded C language program debugging and macro use
- 低代码助力企业数字化转型会让程序员失业?
- Redis的发布与订阅
- Nat address translation
- Embedded interview questions (algorithm part)
猜你喜欢

抢占周杰伦

I feel cheated. Wechat tests the function of "size number" internally, and two wechat can be registered with the same mobile number

SlashData开发者工具榜首等你而定!!!

基于图像和激光的多模态点云融合与视觉定位

微信网页调试8.0.19换掉X5内核,改用xweb,所以x5调试方式已经不能用了,现在有了解决方案

Differences between rip and OSPF and configuration commands

10 schemes to ensure interface data security

数据验证框架 Apache BVal 再使用

Realize payment function in applet

Wireshark analyzes packet capture data * cap
随机推荐
完整的电商系统
Mathematical analysis_ Notes_ Chapter 11: Fourier series
SlashData开发者工具榜首等你而定!!!
Tsinghua, Cambridge and UIC jointly launched the first Chinese fact verification data set: evidence-based, covering many fields such as medical society
抢占周杰伦
String type, constant type and container type of go language
[unity shader] insert pass to realize the X-ray perspective effect of model occlusion
C语言中匿名的最高境界
6.关于jwt
6. About JWT
【Base64笔记】「建议收藏」
能同时做三个分割任务的模型,性能和效率优于MaskFormer!Meta&UIUC提出通用分割模型,性能优于任务特定模型!开源!...
Reuse of data validation framework Apache bval
How much does it cost to develop a small program mall?
嵌入式C语言程序调试和宏使用的技巧
Save the memory of the model! Meta & UC Berkeley proposed memvit. The modeling time support is 30 times longer than the existing model, and the calculation amount is only increased by 4.5%
Redis
初识缓存以及ehcache初体验「建议收藏」
Hutool - lightweight DB operation solution
Five network IO models