• unrecognized service


    报错:danny is not in the sudoers file. This incident will be reported.

    解决方法如下:
    1.进入超级用户模式。也就是输入"su -",系统会让你输入超级用户密码,输入密码后就进入了超级用户模式。

    2.添加sudo文件的写权限,命令是:chmod u+w /etc/sudoers

    3.编辑sudoers文件,vim /etc/sudoers
    找到这行 root ALL=(ALL) ALL,在他下面添加xxx ALL=(ALL) ALL (这里的xxx是你的用户名)
    ps:这里说下你可以sudoers添加下面四行中任意一条
    youuser ALL=(ALL) ALL //允许用户youuser执行sudo命令(需要输入密码)
    %youuser ALL=(ALL) ALL //允许用户组youuser里面的用户执行sudo命令(需要输入密码)
    youuser ALL=(ALL) NOPASSWD: ALL //允许用户youuser执行sudo命令,并且在执行的时候不输入密码
    %youuser ALL=(ALL) NOPASSWD: ALL //允许用户组youuser里面的用户执行sudo命令,并且在执行的时候不输入密码

    4.撤销sudoers文件写权限,命令:
    chmod u-w /etc/sudoers

    这样普通用户就可以使用sudo。

  • 相关阅读:
    vim 多文件操作
    二分查找
    单调栈
    常见TCP问题
    C++为啥引入nullptr?
    python处理表格按照表头为单位的划分并分割到单独的文件
    集合:List,Set,Map
    SpringBoot
    Spring框架
    JavaScript 类型、原型与继承学习笔记
  • 原文地址:https://www.cnblogs.com/chromebook/p/4006681.html
Copyright © 2020-2023  润新知