• 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 858B
    区域赛前立FLAG
    GCJ Practice Contest
    UVa 10004 Bicoloring
    UVa 784 Maze Exploration
    Pacemaker+ISCSI实现Apache高可用-环境准备
    多机免密互信
    HAPROXY + Keepalived
    LVS+KEEPALIVED
    oracle-数据库被注入恶意攻击程序的案例恢复
  • 原文地址:https://www.cnblogs.com/carryLess/p/9586007.html
Copyright © 2020-2023  润新知