本文共 1898 字,大约阅读时间需要 6 分钟。
linux创建sudo用户
sudo
stands for either "superuser do" or "switch user do", and sudo
users can execute commands with root/administrative permissions, even malicious ones. Be careful who you grant sudo
permissions to – you are quite literally handing them the key your house.
sudo
代表“超级用户”或“切换用户”,并且sudo
用户可以执行具有root /管理权限的命令,甚至是恶意的。 请小心,向谁授予sudo
权限-实际上是在将密钥交给您的房子。
Before creating a new sudo
user, you must first create a new user.
在创建新的sudo
用户之前,您必须首先创建一个新用户。
adduser
或useradd
添加新用户 (Use adduser
or useradd
to add a new user)sudo adduser username
Be sure to replace username
with the user that you want to create. Also, note that to create a new user, you must also be a sudo
user yourself.
确保将username
替换为您要创建的用户。 另外,请注意,要创建新用户,您自己还必须是sudo
用户。
passwd
更新新用户的密码 (Use passwd
to update the new user's password)sudo passwd username
A strong password is highly recommended!
强烈建议您使用强密码!
After creating a new user, add them to the appropriate group using the usermod
command.
创建新用户后,使用usermod
命令将其添加到适当的组。
sudo
组 (On Debian systems (Ubuntu / Linux Mint / ElementryOS), add users to the sudo
group)sudo usermod -aG sudo username
wheel
组 (On RHEL based systems (Fedora / CentOS), add users to the wheel
group)sudo usermod -aG wheel username
To delete a user, use the following commands.
要删除用户,请使用以下命令。
sudo deluser username
sudo userdel username
That's all you need to know about creating a new sudo
user in Linux. And remember, "With great power comes great responsibility."
这就是在Linux中创建新的sudo
用户所需的全部知识。 记住,“能力越强,责任就越大”。
翻译自:
linux创建sudo用户
转载地址:http://gqrwd.baihongyu.com/