Linux foundation Premium a (user permissions and management)

Redirect: the output of the previous command is written to a text file

>   : 覆盖重定向
>> : 追加重定向
例  :  cat /etc/passwd  > /opt/1.txt        #重定向会自动创建文本文件

Pipe character: |

将前面命令的输出结果,交由后面的命令处理 也就是说作为后面命令的参数
例 : cat /etc/passwd | head - 2 # 将/etc/passwd 里的内容 管道给 head -2  作为 head -2 的参数 其输出为  /etc/passwd 的前两行

Users and Groups:

用户 : 1 可登录系统    2 确认身份,实现权限控制
组 : 基本组 , 附加组 (一个用户至少属于一个组)

Add User command set:

useradd + Option + username

Options effect
- in At the same time change user when creating the user UID
- d Specifies the user's home directory path when creating a user
- s Change the specified interpreter when creating a user login
- G Create a user while the user is added to the specified group

Set User Password:

交互式 : passwd + 用户名 (超级管理员 需要加 用户名 , 普通用户不需要加)
非交互式 : echo + 新密码 | passwd  --stdin  +  用户名

Management Group:

添加组 : groupadd + 组名
删除组 : groupdel + 组名
管理组成员 : 
	gpasswd  -a  用户名  +  组名      #添加用户到指定组
	gpasswd  -d  用户名  +  组名      #删除指定组的用户

User management:
chmod + Option + username

Options effect
- in Modify User UID
- d Home directory path
- s Modify the user login interpreter
- G Additional modifications to the specified user group

Delete user:
userdel - r + username
######################################### ################################################## #########
/ etc / passwd to store information: username: password placeholder: UID: basic user group GID: description information (mostly empty): home directory: interpreter program

Guess you like

Origin blog.csdn.net/Win_Le/article/details/95101965