当前位置:网站首页>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…
边栏推荐
猜你喜欢
随机推荐
Spark源码-任务提交流程之-6.2-sparkContext初始化-TaskScheduler任务调度器
如何用UE5渲染一个可爱的茶壶屋?
C语言程序死循环问题解析——变量被修改
每日一题-二分法
【Day8】使用LVM扩容所涉及的命令
错误类型:reflection.ReflectionException: Could not set property ‘xxx‘ of ‘class ‘xxx‘ with value ‘xxx‘
入门文档12 webserve + 热更新
电子产品量产工具(1)- 显示系统实现
浅谈遇到的小问题
CIPU,对云计算产业有什么影响
spark源码-任务提交流程之-7-流程梳理总结
huatuo 革命性热更新解决方案系列1·1 为什么这么NB?huatuo革命Unity热更新
每日一题-正则表达式匹配-0715
入门文档07 分阶段输出
电子产品量产工具(3)- 文字系统实现
快问快答—腾讯云服务器常见问题解答
unity实现第一人称漫游(保姆级教程)
每日一题-电话号码的字母组合-0717
手把手教你搭建小程序
每日一题-合并K个升序链表-0722