博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Linux系统配置及服务管理_第03章用户管理
阅读量:7124 次
发布时间:2019-06-28

本文共 2090 字,大约阅读时间需要 6 分钟。

大家好,我是霸王卸甲,昨天因为工作上的事情,忘记更了,今天上午补上昨天的文章,每周周六周日停更两天。

1.用户/组基本概念: ①概念:Users and groups:

. Every process (running program) on the system runs as a particular user.
. Every file is owned by a particular user.
. Access to files and directories are restricted by user.
. The user associated with a running process determines the files and directories accessible to that process.
②查看当前登录的用户信息:Linux系统配置及服务管理_第03章用户管理

③查看文件的owner:[root@tianyun ~]# ll /home/                                                                            drwx------. 4 alice alice 4096 Jun 2 15:59 alice                                                                            drwx------. 2 root root 16384 Jun 1 23:09 lost+found                                                                             drwxr-xr-x 2 root root 4096 Jun 2 15:33 tianyun                                                                         ④查看运行进程的username:USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND                                                                            root 1 0.0 0.0 19360 1536 ? Ss 13:29 0:00 /sbin/init                                                                               root 2 0.0 0.0 0 0 ? S 13:29 0:00 [kthreadd]                                                                             root 3 0.0 0.0 0 0 ? S 13:29 0:00 [migration/0]  root 4 0.0 0.0 0 0 ? S 13:29 0:00 [ksoftirqd/0]

2.用户/组管理:首先给大家讲的是用户如下图Linux系统配置及服务管理_第03章用户管理

然后是用户组:用户组又分为基本组和附加组

1创建用户
#useradd testA
#useradd testB

2 查看用户UID/GID

#cat /etc/passwd
testA:X:1000:1000 (UID:GID-基本组ID)
testB:X:1001:1001

3 创建个新组,查询组ID为1002.

#groupadd groupT
#cat /etc/group
goutpT::1002:

4 请用“usermod -g”修改用户的基本组为1002.

#usermod -g groupT testA

5 查询用户GID,由1000,更改为1002

#cat /etc/passwd
testA:X:1000:1002 (UID:GID-基本组ID)
testB:X:1001:1001

附加组:1创建用户

#useradd testA
#useradd testB
2 查看组信息
#cat /etc/group
testA::1001:
testB::1002:
3 将用户加入其他组。
语法 -G 附加组 组名 用户名
usermod -G testB testA
4 查看附加组的成员
#cat /etc/group
testA::1001:
testB::1002:testA(用户)

提权(了解):这个部分大家了解下就可以了、

Linux系统配置及服务管理_第03章用户管理

**今天的文章就到这里了,感谢大家的支持,在这里给大家道个歉,因为本人感冒,文章内容结构会整理的不太好,请大家多多包容,谢谢大家,明天见。**

转载于:https://blog.51cto.com/13575683/2063062

你可能感兴趣的文章
CodeIgniter报错: You must use the "set" method to update an entry
查看>>
如何开启ubuntu的SSH服务(不要和openssl搞混淆了)
查看>>
H5常用技巧
查看>>
Electron使用与学习--(页面间的通信)
查看>>
几种常用加密算法比较
查看>>
[摘录]时间会证明一切
查看>>
上海市五险一金及税后工资计算器
查看>>
【C语言入门教程】1.2 函数库 和 链接
查看>>
ArcGIS Server密码丢失
查看>>
自动化(Automation)兼容的数据类型
查看>>
Spark Streaming使用Kafka保证数据零丢失
查看>>
全排列递归算法
查看>>
.net 中读取自定义Config文件
查看>>
【分布式】分布式架构
查看>>
SQL四种语言:DDL,DML,DCL,TCL
查看>>
gulp学习笔记1
查看>>
zip 压缩文件 unzip查看zip压缩包内的内容
查看>>
can not find UIAutomationClient
查看>>
git revert 和 git reset的区别
查看>>
Spring 读取配置文件(二)
查看>>