zoukankan      html  css  js  c++  java
  • linux下普通用户无法使用sudo命令问题

      今天在新装的linux虚拟机中使用sudo命令时,报错如下

    We trust you have received the usual lecture from the local System
    Administrator. It usually boils down to these three things:
    
        #1) Respect the privacy of others.
        #2) Think before you type.
        #3) With great power comes great responsibility.

      

      解决方法:(在sudoers配置文件(/etc/sudoers)中加入需要用户配置即可)

      1.切换到root用户下

        终端中执行 su 命令,然后输入密码,从普通用户切换为根用户

       2.为sudoers配置文件添加写权限

        sudoers文件位于 /etc 目录下,其为系统配置sudo用户的一个只读配置文件。在root身份下执行 chmod +w /etc/sudoers命令为该文件添加写权限。

      3.编辑配置文件  

      vi /etc/sudoers

       加入如下配置:用户名  ALL=(ALL)ALL,保存并退出

       4.su切换回普通用户,再次执行sudo命令,已经可以使用

       

        

  • 相关阅读:
    CodeForces
    CodeForces
    CodeForces
    【模板】POJ-1511(dijkstra堆优化+链式前向星)
    【模板】POJ-1502(dijkstra)
    P2862 [USACO06JAN]Corral the Cows G
    P2495 [SDOI2011]消耗战
    CF613D Kingdom and its Cities
    P4655 [CEOI2017]Building Bridges
    P3917 异或序列
  • 原文地址:https://www.cnblogs.com/carryLess/p/9586007.html
Copyright © 2011-2022 走看看