当前位置:网站首页>User and user group management, file permission management
User and user group management, file permission management
2022-08-05 06:15:00 【sologuai】
1. Manage user accounts
- Categories
Super user: The root user is the default super user account in the Linux operating system, and has the highest authority to the host. The super user is the only one in the system.
Ordinary user: Created by the root user or other administrator users, the permissions they have will be limited. Generally, they only have full permissions in the user's own home directory.
Program users: When installing the Linux operating system and some applications, some specific low-privilege user accounts will be added. These users are generally not allowed to log in to the system, and are only used to maintain the normal operation of the system or a program, such asbin, daemon, ftp, mail, etc.
2.uid logo
- The UID of the root user account has a fixed value of 0
- The default UID of the program user account is Centos5,6: 1~499, Centos7: 1~999
- The default UID for common users is Centos5, 6: 500~ 65535, Centos7: 1000~ 60000
Second, add user account useradd
useradd [options] username
-u specifies the user's UID
[[email protected] ~]# useradd -u 2000 helen //Add the helen user and specify the UID as 2000[[email protected] ~]# tail -1 /etc/passwd //View the information of helen in passwdhelen:x:2000:2000::/home/helen:/bin/bash-s specifies the user's login shell (usually for program users)
[[email protected] ~]# useradd -s /sbin/nologin apache //Create a user and specify the login shell as /sbin/nologin, the user cannot log in to the system[[email protected] ~]# tail -1 /etc/passwdapache:x:2008:2008::/home/apache:/sbin/nologinThree, set/change the user password passwd
passwd [username]
Set or modify user password
[[email protected] ~]# passwd nancy //Set or modify the password of the nancy userChange the password for user nancy.new password:Re-enter new password:passwd: All authentication tokens have been successfully updated.[[email protected] ~]# echo "linux666" | passwd --stdin nancy //Easy to set user passwordChange the password for user nancy.passwd: All authentication tokens have been successfully updated.Fourth, modify the attribute usermod of the user account
usermod [options]... username
[[email protected] ~]# usermod -l sasha helen //Change the username of helen to sasha[[email protected] ~]# usermod -L sasha //Lock user sasha[[email protected] ~]# passwd -S sasha //View sasha status, it has been lockedsasha LK 2022-02-21 0 99999 7 -1 (Password is locked.)[[email protected] ~]# usermod -U sasha //Unlock user sasha[[email protected] ~]# passwd -S sasha //View sasha status, normal statusFive, set the attribution of files and directories chown
chown owner file or directory //modify owner
chown:group file or directory //modify group
chown owner:group file or directory //modify owner and group
-R: recursively modify the ownership of all files and subdirectories in the specified directory
Six, file and directory permissions management chmod
The read, write, and execute permissions of the file can be represented by the characters r, w, x, or as the octal numbers 4, 2, and 1, respectively
边栏推荐
猜你喜欢

Technology Sharing Miscellaneous Technologies

Network wiring and digital-to-system conversion

入门文档04 一个任务依赖另外一个任务时,需要按顺序执行

运维的高光时刻,从智能化开始

spark源码-任务提交流程之-1-sparkSubmit

OpenCV3.0 兼容VS2010与VS2013的问题

网络布线与数制转换

IP packet format (ICMP protocol and ARP protocol)

Mongodb query analyzer parsing

Getting Started Documentation 10 Resource Mapping
随机推荐
调用TensorFlow Objection Detection API进行目标检测并将检测结果保存至本地
Dsf5.0 bounced points determine not return a value
ALC实验
【Day8】(超详细步骤)使用LVM扩容
NIO works is analysed
【Day6】文件系统权限管理 文件特殊权限 隐藏属性
入门文档11 自动添加版本号
Switch principle
Autoware中安装Yolo3目标检测模块遇到的问题
Remembering my first CCF-A conference paper | After six rejections, my paper is finally accepted, yay!
spark算子-wholeTextFiles算子
dsf5.0 弹框点确定没有返回值的问题
网络不通?服务丢包?看这篇就够了
ACL 和NAT
深度 Zabbix 使用指南——来自惨绿少年
Autoware--北科天绘rfans激光雷达使用相机&激光雷达联合标定文件验证点云图像融合效果
NAT实验
入门文档07 分阶段输出
Hard Disk Partitioning and Permanent Mounting
markdown editor template