当前位置:网站首页>Account and Permission Management
Account and Permission Management
2022-08-05 06:08:00 【Magic star】
Account and permission management
Account and permission management
3A认证方式:
A(Authentication): 验明正身 (A.Account passwords correspond one by one,B.生物特征 C.短信验证)
A( Authorization): 授权 (What user has what kind of permissions)
A(Accounting): 审计 (what user did what,what consequences)
Kind of user:

系统启动的时候, There is no logged in user
程序用户:专门to the user of the program,无需登录,Directly start the program program user is for program use,Ordinary user super administrator user is for people to use,Users who are not logged in to use,Only run some programs user,Only assign program users to running programs
w命令:See the currently logged in user

Kind of group(A user must have a basic group)
- 基本组:A user must have a basic group,且只有一个
- 附加组:A user can have no additional groups,There can also be multiple additional groups
The distinction between basic groups and additional groups
The group in which the user comes first is the basic group,后面的都是附加组
uid、gid
- uid:The unique identifier used by the system to identify the user
uid只能是整数,0-60000 ,不能重复(超级管理员的uid一定 是0)
uid的范围(centos7)
1、超级管理员的uid:0
2、程序用户uid范围:1-999
3、普通用户uid范围:1000-60000
gid:A unique identifier used by the system to identify the group
- /etc/passwd (存放用户信息)
- /etc/shadow(存放密码信息)
- useradd (添加用户)
通式:useradd [选项]… 用户名
| 选项 | 含义 |
|---|---|
| -u | 指定uid |
| -g | 指定基本组(组名和gid都可以) |
| -G | 指定附加组 |
| -d | 指定家目录 |
| -M | 不建立家目录 |
| -s | Specifies the default loginshell |
| -e | 指定用户失效时间,可使用YYYY-MM-DD的日期格式 |
| -r | 建立系统用户 |

No option is added when creating a user
1、will be used in orderuid号
2、A basic group with the same name as the user name will be created
3、按顺序使用gid
4、会在/homeCreate a home directory with the same name as the username
5、会将用户信息保存在/etc/passwd文件中passwd:修改密码
格式:passwd +用户名
passwd +[选项]+用户名
-l :锁定用户,Not allowed to log in
-u:解锁
-d:清空密码,无需使用密码,直接登入
-S:查看锁定状态usermond (Modify the properties of an existing user)
| 选项 | 含义 |
|---|---|
| -l | 修改用户登录名 |
| -L | 锁定用户 |
| -U | 解锁用户 |
| -u | 指定uid |
| -g | 指定基本组(组名和gid都可以) |
| -G | 指定附加组(组名和gid都可以) |
| -d | 指定家目录 |
| -M | 不建立家目录 |
| -s | Specifies the default loginshell |
| -e | 指定用户失效时间,可使用YYYY-MM-DD的日期格式 |
- userdel:删除用户
-r :连家目录一起删除
权限管理

rw- :文件的主人 (属主)
r-- :文件所属的组 (属组)
r-- :其他人
注:
1、File minimum permissions are x,一定要有,否则无法进行任何操作(Super administrators are not affected)
2、Deleting a file is related to the permissions of the folder where it is located,It has nothing to do with itself.
r-- =4(8进制)
-w-=2(8进制)
- -x =1(8进制)
rwx=7(8进制)
例题:将1.txtAll permissions of 可读可执行
三种特殊权限(suid、sgid、sticky)
suid

sgid

sticky
#具有写权限的目录通常用户可以删除该目录中的任何文件,无论该文件的权限或拥有权
#在目录设置Sticky 位,只有文件的所有者或root可以删除该文件
#sticky 设置在文件上无意义
#Sticky权限设定:
chmod o+t DIR…
chmod o-t DIR…
边栏推荐
猜你喜欢
随机推荐
添加新硬盘为什么扫描不上?如何解决?
【UiPath2022+C#】UiPath 练习-数据操作
UiPath简介
LeetCode刷题之第23题
亲身实感十多年的面试官面试的题目
每日一题-三数之和-0716(2)
不吹不黑,这的确是我看过微服务架构最好的文章!
C语言—扫雷的实现
spark算子-textFile算子
SSL证书提示过期或者无效,该怎么处理呢?
(C语言)计算结构体大小——结构体内存对齐
vim的三种模式
D39_向量
I217-V在openwrt软路由下大流量断网问题
成功的独立开发者应对失败&冒名顶替综
什么是阿里云·速成美站?
LeetCode刷题之第33题
电子产品量产工具(3)- 文字系统实现
Leetcode刷题——对链表进行插入排序
(oj)原地移除数组中所有的元素val、删除排序数组中的重复项、合并两个有序数组









