zoukankan      html  css  js  c++  java
  • Debian普通用户能够sudo的办法

      su进入超级用户(root), 然后运行 visudo, 一定使用visudo命令来编辑,不然会提示如下错误:

        “sudo: 没有找到有效的 sudoers 资源,退出

         sudo: 无法初始化策略插件 ”

      visudo默认打开/etc/sudoers文件进行编辑, 调用的nano编辑。

      如下, 将XX处改为你的普通用户, Ctrl+O写入文件, Ctrl+X退出即可:

     

     1 root@bb-debian:/home/bb# cat /etc/sudoers
     2 #
     3 # This file MUST be edited with the 'visudo' command as root.
     4 #
     5 # Please consider adding local content in /etc/sudoers.d/ instead of
     6 # directly modifying this file.
     7 #
     8 # See the man page for details on how to write a sudoers file.
     9 #
    10 Defaults    env_reset
    11 Defaults    mail_badpass
    12 Defaults    secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
    13 
    14 # Host alias specification
    15 
    16 # User alias specification
    17 
    18 # Cmnd alias specification
    19 
    20 # User privilege specification
    21 root    ALL=(ALL:ALL) ALL
    22 XX   ALL=(ALL:ALL) ALL
    23 
    24 # Allow members of group sudo to execute any command
    25 %sudo    ALL=(ALL:ALL) ALL
    26 
    27 # See sudoers(5) for more information on "#include" directives:
    28 
    29 #includedir /etc/sudoers.d
  • 相关阅读:
    K8s环境搭建
    opencv一些重要的函数或者类
    opencv的点的表示
    opencv矩阵的格式输出
    opencv矩阵运算(二)
    opencv矩阵运算(一)
    如何安装指定版本的Kubernetes
    使用minikube快速部署k8s集群
    Ceph 存储集群
    学习tcpIp必备的抓包工具wireshark
  • 原文地址:https://www.cnblogs.com/virqin/p/4672060.html
Copyright © 2011-2022 走看看