Files
chill_notes/Linux/Ubuntu/Ubuntu用户管理.md
2026-04-21 20:24:09 +08:00

20 lines
512 B
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. 添加一个用户组并指定id为1002
sudo groupadd g 1002 www
2. 添加一个用户到www组并指定id为1003
sudo useradd wyx -g 1002 -u 1003 -m
3. 修改用户的密码
sudo passwd wyx
4. 删除一个用户
sudo userdel wyx
5. 为该用户添加sudo权限
sudo usermod -a -G adm wyx
sudo usermod -a -G sudo wyx
6. 查看所有用户和用户组:
cat /etc/passwd
cat /etc/group
> 来自 <[https://www.cnblogs.com/vincedotnet/p/4017574.html](https://www.cnblogs.com/vincedotnet/p/4017574.html)>