当前位置:网站首页>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的方法来删除。
这样的话连添加的目录也可以删除。
虽然报错了,但是不影响。
边栏推荐
- unity2d的Rigidbody2D的MovePosition函数移动时人物或屏幕抖动问题解决
- Interview vipshop internship testing post, Tiktok internship testing post [true submission]
- What is the general yield of financial products in 2022?
- Basic operation of chain binary tree (implemented in C language)
- gsap动画库
- Scientists have observed for the first time that the "electron vortex" helps to design more efficient electronic products
- 持续测试(CT)实战经验分享
- 国内首次!这家中国企业的语言AI实力被公认全球No.2!仅次于谷歌
- 线程池中的线程工厂
- Kirk Borne的本周学习资源精选【点击标题直接下载】
猜你喜欢

50亿,福建又诞生一只母基金

Scientists have observed for the first time that the "electron vortex" helps to design more efficient electronic products

Reuse of data validation framework Apache bval

强化学习-学习笔记8 | Q-learning

Kubernetes DevOps CD工具对比选型
![学习open62541 --- [67] 添加自定义Enum并显示名字](/img/98/e5e25af90b3f98c2be11d7d21e5ea6.png)
学习open62541 --- [67] 添加自定义Enum并显示名字

Nunjuks template engine

A hodgepodge of ICER knowledge points (attached with a large number of topics, which are constantly being updated)

RIP和OSPF的区别和配置命令

6. About JWT
随机推荐
How much does it cost to develop a small program mall?
2022-07-04 matlab读取视频帧并保存
【Unity Shader】插入Pass实现模型遮挡X光透视效果
[paper sharing] where's crypto?
Kirk borne's selection of learning resources this week [click the title to download directly]
The highest level of anonymity in C language
PTA 1101 B是A的多少倍
手把手教姐姐写消息队列
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
嵌入式面试题(算法部分)
小试牛刀之NunJucks模板引擎
ES6笔记一
unity2d的Rigidbody2D的MovePosition函数移动时人物或屏幕抖动问题解决
国内首次!这家中国企业的语言AI实力被公认全球No.2!仅次于谷歌
AntiSamy:防 XSS 攻击的一种解决方案使用教程
Wireshark analyzes packet capture data * cap
【HDU】5248-序列变换(贪心+二分)「建议收藏」
LeetCode 497(C#)
99% of people don't know that privatized deployment is also a permanently free instant messaging software!
Basic concepts and properties of binary tree