Files
linux-wiki/content/linux 入门/第一章/1.7.md
2021-10-21 14:57:58 +08:00

39 lines
1.7 KiB
Markdown
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#1.7### 用户管理
1. /etc/passwd 用户
1. `sudo vipw` 编辑
2. /etc/shadow 加密后的密码
1. `sudo vipw -s` 编辑
3. /etc/group 组
4. getent 浏览帐号文件信息
5. passwd 设置帐号密码
1. passwd -g 设置用户组密码
6. /etc/sudoers 可用sudo提升权限的账户
1. visudo 编辑
7. gpasswd 用户组设置
8. chsh 变更登录shell
1. /etc/shells :支持的shell列表
2. /etc/bash.bashrc 初始脚本
3. /etc/profile 登录脚本
9. chfn 变更账户个人信息
10. newgrp/sg 变更主用户组
11. groups 列出当前帐号所属的用户组列表
12. id 显示当前帐号相关情况
13. addgroup 创建用户组
14. delgroup 删除用户组
15. groupmod 修改用户组
16. adduser 添加或修改账户
1. /etc/adduser.conf
2. /etc/skel 模板
3. `sudo adduser user group` 添加用户到组linux对这个加入用户组的概念实现得非常反人类
17. 权限
1. u所有者user、g用户组group、o其他other
2. 文件r读read、w写write、x执行exectute、u+s授权所有者uid执行二进制程序g+s 所有者组gid执行二进制程序
1. `chmod u+s`设置u为s授权使用所有者权限执行
2. `chmod g+s`设置g为s授权使用用户组权限执行
3. `chmod o+t` 无效
3. 目录r列出文件、w添加删除文件、x进入文件夹、g+s新建文件继承组gid、
o+t其他人不能删除
1. `chmod u+s` 无效
2. `chmod g+s`设置g为s目录内继承目录用户组
3. `chmod o+t`设置o为t目录下的文件仅文件所有者目录所有者和root可以删除其他人无法删除不递归