当前位置:网站首页>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…
边栏推荐
猜你喜欢
随机推荐
(oj)原地移除数组中所有的元素val、删除排序数组中的重复项、合并两个有序数组
Blender软件介绍与使用心得
账号与权限管理
dsf5.0新建页面访问时重定向到首页的问题
Remembering my first CCF-A conference paper | After six rejections, my paper is finally accepted, yay!
D46_给刚体施加的力
电子产品量产工具(4)-UI系统实现
C语言入门笔记 —— 初识
电子产品量产工具(2)- 输入系统实现
TensorFlow ObjecDetectionAPI在win10系统Anaconda3下的配置
每日一题-电话号码的字母组合-0717
入门文档01 series按顺序执行
入门文档10 资源映射
入门文档08 条件插件
Unity中的GetEnumerator 方法及MoveNext、Reset方法
小度 小度 在呢!
如何用UE5渲染一个可爱的茶壶屋?
“元宇宙”是个啥?都有哪些大招?
来来来,一文让你读懂Cocos Creator如何读写JSON文件
C语言—三子棋的实现









