编辑文件/etc/sudoers
用命令打开vi /etc/sudoers
打开之后,文件内容如下:
# /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL) ALL
# Allow members of group sudo to execute any command after they have
# provided their password
# (Note that later entries override this, so you might need to move
# it further down)
%sudo ALL=(ALL) ALL
#
#includedir /etc/sudoers.d
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
%administrator ALL=(ALL) ALL
在文件末尾,添加新的用户:
例如:新用户名为aabb
%aabb ALL=(ALL)ALL
本文介绍如何使用visudo命令编辑/etc/sudoers文件,并详细解释了文件内容含义及如何添加新用户以允许其通过sudo获得管理员权限。
1万+

被折叠的 条评论
为什么被折叠?



