AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题 / 588783
Accepted
NoFence
NoFence
Asked: 2015-02-23 21:00:21 +0800 CST2015-02-23 21:00:21 +0800 CST 2015-02-23 21:00:21 +0800 CST

默认用户如何在不在 sudoers 中列出的情况下获得 sudo 访问权限?

  • 772

我有一个关于 command 的问题sudo。

基本上,您知道,sudo允许任何注册的允许用户/etc/sudoers执行其中指定的一些命令。

此时,我想知道我的默认用户帐户如何使用sudo.

以下是我的/etc/sudoers文件内容。

# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults        env_reset
Defaults        mail_badpass
Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root    ALL=(ALL:ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d

如您所见,我的帐户 - jwl- 未在该文件中注册。但是我可以sudo毫无问题地使用命令。怎么可能?有什么我不知道的机制吗?如果是这样,请告诉我。

感谢您阅读。

sudo
  • 1 1 个回答
  • 2517 Views

1 个回答

  • Voted
  1. Best Answer
    muru
    2015-02-23T21:06:56+08:002015-02-23T21:06:56+08:00

    如果您的帐户是在安装期间创建的,它将成为该sudo组的一部分,并且该sudo文件中提到了该组(带有 的行%sudo)。您可以通过运行命令来确认这一点,该groups命令列出了您的用户所属的组。

    • 3

相关问题

  • GUI sudo 不工作?

  • 如何在 sudo 下只运行一次桌面图形应用程序?

  • 如何将用户添加到“sudo”组?

  • Nautilus 自动以 root 身份浏览

  • 为什么我需要 root 权限才能在命令行中卸载驱动器,而不是在 Nautilus 中?如何改变它?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve