当前位置:网站首页>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…
边栏推荐
猜你喜欢
随机推荐
C语言入门笔记 —— 初识
什么是全栈设计师?
每日一题-盛最多水的容器-0716
每日一题-最长有效括号-0724
spark算子-textFile算子
Remembering my first CCF-A conference paper | After six rejections, my paper is finally accepted, yay!
硬盘分区和永久挂载
海外服务器的优势
入门文档03 区分开发与生产环境(生产环境才执行‘热更新’)
每日一题-有效的括号-0719
游戏引擎除了开发游戏还能做什么?
论那些给得出高薪的游戏公司底气到底在哪里?
每日一题-三数之和-0716(2)
入门文档05-2 使用return指示当前任务已完成
电子产品量产工具(1)- 显示系统实现
每日一题-电话号码的字母组合-0717
spark源码-任务提交流程之-1-sparkSubmit
专有宿主机CDH
D39_欧拉角与四元数
快问快答—腾讯云服务器常见问题解答









