From 4c6cbe561cb2c62ffd6b308f2506869db71b31be Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 1 Jul 2023 17:42:28 +0800 Subject: [PATCH] RP @geekpi https://linux.cn/article-15958-1.html --- ...ays to Add Users to SUDOERS Group in Debian.md | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) rename {translated/tech => published}/20230623.0 ⭐️ 2 Ways to Add Users to SUDOERS Group in Debian.md (76%) diff --git a/translated/tech/20230623.0 ⭐️ 2 Ways to Add Users to SUDOERS Group in Debian.md b/published/20230623.0 ⭐️ 2 Ways to Add Users to SUDOERS Group in Debian.md similarity index 76% rename from translated/tech/20230623.0 ⭐️ 2 Ways to Add Users to SUDOERS Group in Debian.md rename to published/20230623.0 ⭐️ 2 Ways to Add Users to SUDOERS Group in Debian.md index 33cdb6ba7f..f52b02726d 100644 --- a/translated/tech/20230623.0 ⭐️ 2 Ways to Add Users to SUDOERS Group in Debian.md +++ b/published/20230623.0 ⭐️ 2 Ways to Add Users to SUDOERS Group in Debian.md @@ -3,18 +3,20 @@ [#]: author: "Arindam https://www.debugpoint.com/author/admin1/" [#]: collector: "lkxed" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-15958-1.html" 在 Debian 中将用户添加到 SUDOERS 组的 2 种方法 ====== -**以下是如何将用户添加到 Debian Linux 中的 SUDOERS 组。** +![][0] + +> 以下是如何将用户添加到 Debian Linux 中的 SUDOERS 组的方法。 在 Debian Linux 中,SUDOERS 组在向用户授予管理权限方面发挥着至关重要的作用。将用户添加到 SUDOERS 组使他们能够以 root 权限执行命令,从而为他们提供必要的管理访问权限以在 Debian 系统上执行各种任务。 -在安装 Debian Linux 的过程中,如果你将 “root” 帐户的密码保留为空,那么系统中的[创建的第一个用户][1]将拥有管理权限。但是,如果你设置了 “root” 密码,那么用户名将不具有 sudo 权限。因此,在使用用户帐户执行管理任务时,你可能会遇到以下类似的错误。 +在安装 Debian Linux 的过程中,如果你将 `root` 帐户的密码保留为空,那么系统中的 [创建的第一个用户][1] 将拥有管理权限。但是,如果你设置了 `root` 密码,那么用户名将不具有 sudo 权限。因此,在使用用户帐户执行管理任务时,你可能会遇到以下类似的错误。 ``` is not in the sudoers file. This incident will be reported. @@ -37,7 +39,7 @@ su - 系统将提示你提供 root 密码。输入 root 密码并按回车键。 -以 root 用户身份登录后,输入以下命令。确保根据你的用户名进行更改。在此示例中,将 “arindam” 替换为你的用户名。 +以 root 用户身份登录后,输入以下命令。确保根据你的用户名进行更改。在此示例中,将 `arindam` 替换为你的用户名。 ``` /sbin/addgroup arindam sudo @@ -65,7 +67,7 @@ su - nano /etc/sudoers ``` -添加以下行和用户名。根据你的用户名更改 “arindam”。 +添加以下行和用户名。根据你的用户名替换 `arindam`。 ``` arindam ALL=(ALL) ALL @@ -75,7 +77,7 @@ arindam ALL=(ALL) ALL ### 验证 SUDOERS 组成员 -要验证用户是否已成功添加到 SUDOERS 组,你可以打开一个新的终端窗口并输入以下命令。将 “username” 替换为你添加到 SUDOERS 组的用户的实际用户名。 +要验证用户是否已成功添加到 SUDOERS 组,你可以打开一个新的终端窗口并输入以下命令。将 `arindam` 替换为你添加到 SUDOERS 组的用户的实际用户名。 ``` sudo -l -U arindam @@ -91,6 +93,8 @@ sudo -l -U arindam 请记住在委派管理权限时要小心谨慎,并定期检查用户权限以维护安全的 Debian 系统。 +*(题图:MJ/c71c2f28-51c7-44c7-87be-af88088bf459)* + -------------------------------------------------------------------------------- via: https://www.debugpoint.com/add-users-sudoers/ @@ -106,4 +110,5 @@ via: https://www.debugpoint.com/add-users-sudoers/ [b]: https://github.com/lkxed/ [1]: https://www.debian.org/releases/stable/amd64/ch06s03.en.html#user-setup-root [2]: https://www.debugpoint.com/wp-content/uploads/2023/06/Before-adding-a-user-to-SUDOERS-group.png -[3]: https://www.debugpoint.com/wp-content/uploads/2023/06/After-granting-priviledges.png \ No newline at end of file +[3]: https://www.debugpoint.com/wp-content/uploads/2023/06/After-granting-priviledges.png +[0]: https://img.linux.net.cn/data/attachment/album/202307/01/174031t6p74rx6ixlmyjr7.jpg \ No newline at end of file