• linux 普通用户使用sudo权限


      sudo是Linux系统管理指令,是允许系统管理员让普通用户执行一些或者全部root命令的一个工具。Linux系统下,为了安全,一般来说我们操作都是在普通用户下操作,但是有时候普通用户需要使用root权限,比如在安装软件的时候。这个时候如果我们切回root用户下效率就会比较低,所以用sudo命令就会很方便。

    安装sudo

    yum install sudo
    
    [root@VM_0_6_centos ~]# yum install sudo 
    Loaded plugins: fastestmirror, langpacks
    Repository epel is listed more than once in the configuration
    Loading mirror speeds from cached hostfile
    Resolving Dependencies
    --> Running transaction check
    ---> Package sudo.x86_64 0:1.8.19p2-13.el7 will be updated
    ---> Package sudo.x86_64 0:1.8.23-4.el7_7.2 will be an update
    --> Finished Dependency Resolution
    ……

    修改权限

    /etc/sudoers文件默认是只读权限,必须修改为可写,修改后可以复原回去

    chmod u+w /etc/sudoers 

    修改文件

    给普通用户XX添加sudo权限

    xx  ALL=(ALL)       ALL

    执行

    [xx@VM_0_6_centos ~]$ sudo pip3 install requests
    
    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.
    
    [sudo] password for xx: 
  • 相关阅读:
    菜鸡的Java笔记 第二十八
    菜鸡的Java笔记 第二十七
    菜鸡的Java笔记 第二十六
    菜鸡的Java笔记 第二十五 wrapperClass 包装类
    bzoj3238 [Ahoi2013]差异
    bzoj4516 [Sdoi2016]生成魔咒
    bzoj3998 [TJOI2015]弦论
    bzoj1965 [Ahoi2005]洗牌
    bzoj4896 [Thu Summer Camp2016]补退选
    bzoj5055 膜法师
  • 原文地址:https://www.cnblogs.com/xiao-apple36/p/12688584.html
Copyright © 2020-2023  润新知