2016 - 2024

感恩一路有你

rpmbuild的安装包无法执行脚本 如何在linux上用命令实现用户和组的管理?

浏览量:4978 时间:2023-06-14 10:09:39 作者:采采

如何在linux上用命令实现用户和组的管理?

Linux上用命令实现本地用户和组的管理

本地用户和组:管理文件和进程等等

本地用户和组:

1)root: 超级管理员 系统创建的第一个账户

特点:

id为:0

家目录:/root

具有系统的完全控制权: 小心使用。

[ ~]# id

uid0(root) gid0(root) groups0(root) contextunconfin:unconfin:unconfin:s0-s0:c0.c1023

[ ~]#

2)普通用户: 不具有管理员权限

特点:

id范围:

1000 lt id lt60000

家目录: /home/用户名

[ ~]# id student

uid1000(student) gid1000(student) groups1000(student),10(wheel)

[ ~]#

3)服务用户: 为服务提供权限

特点:

id范围:

0 lt id lt 1000

家目录:应用程序服务目录

[ ~]# id apache

uid48(apache) gid48(apache) groups48(apache)

[ ~]#

如果是yum,rpm安装的软件: 由rpm包中的脚本创建服务账户

Include *.conf

#

# If you wish httpd to run as a different user or group, you must run

# httpd as root initially and it will switch.

#

# Us: The name (or #number) of the user/group to run httpd as.

# It is usually good practice to create a dedicated user and group for

# running httpd, as with most system services.

#

User apache

Group apache

# Main server配置#本地组:1)主要组:用户必须属于主要组。当一些用户创建一个文件时,给该文件所属的组。2)下属组:用户容器,组织管理用户权限。控制角色:文件:

用户 权限 特点 id

版权声明:本文内容由互联网用户自发贡献,本站不承担相关法律责任.如有侵权/违法内容,本站将立刻删除。