zoukankan      html  css  js  c++  java
  • 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: 
  • 相关阅读:
    swift中? ! weak unowned以及动态时语言理解
    线程状态---Day24
    线程安全---Day23
    线程---Day22
    异常---Day21(写得有错请指出,感谢)
    Java之路---Day18(List集合)
    Java之路---Day17(数据结构)
    Java之路---Day16(泛型)
    Hoeffding不等式证明
    事件绑定之.bind()
  • 原文地址:https://www.cnblogs.com/xiao-apple36/p/12688584.html
Copyright © 2011-2022 走看看