Files
My-Notes/笔记/Linux/基础指令/useradd&userdel&id&usermod.md
T

20 lines
517 B
Markdown
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.
# 创建用户:useradd \[-g -d] \[用户名]
参数:
- -g:指定用户的组,不指定会创建同名组并加入,如果有同名组必须用-g
- -d:指定用户的home路径,默认在`/home/用户名`
# 删除用户:userdel \[-r] \[用户名]
参数:
- -r:删除用户的HOME目录,附带即可无需指定path
# 查询用户所属组:id \[用户名]
# 修改用户:usermod \[-aG] \[用户组] \[用户名]
作用:将指定的用户加入指定的用户组中
参数:
- aG