当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
NIO工作方式浅析
Spark source code-task submission process-6.1-sparkContext initialization-create spark driver side execution environment SparkEnv
入门文档06 向流(stream)中添加文件
I/O性能与可靠性
I/O performance and reliability
spark operator-parallelize operator
vim的三种模式
智能运维会取代人工运维吗?
[Paper Intensive Reading] The relationship between Precision-Recall and ROC curves
时间复杂度和空间复杂度
Apache configure reverse proxy
Dsf5.0 bounced points determine not return a value
调用TensorFlow Objection Detection API进行目标检测并将检测结果保存至本地
入职前,没想到他们玩的这么花
LinkSLA坚持用户第一,打造可持续的运维服务方案
spark算子-map vs mapPartitions算子
[Day8] Commands involved in using LVM to expand
【Day8】(超详细步骤)使用LVM扩容
7步完成云上监控
ACLs and NATs




![[Day8] Commands involved in using LVM to expand](/img/ba/39b81cbcecec9bc54a710ff9dba81a.png)




