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: 
  • 相关阅读:
    Linux Command
    sql查询将列里面的值替换为别的值但是实际值不变
    MY_SQLCode
    ComboBox设置Text属性
    WPF bmp和二进制转换
    C#中打开文件、目录、保存窗口
    WPF实现右键菜单
    BarTender SDK 实现调用模板条码打印
    VS Code非英语版本连接TFS错误解决方案
    DBeaver连接达梦数据库
  • 原文地址:https://www.cnblogs.com/xiao-apple36/p/12688584.html
Copyright © 2011-2022 走看看