zoukankan      html  css  js  c++  java
  • 普通用户授予root权限

    开始用linux的时候会遇到用户权限问题,比如安装软件的时候经常会提示权限不足,下面介绍给普通用户授予root权限。

    找到  cd /etc/sudoers可以看到用户的权限是:只有读取的权限(以下操作都是用root用户)

    -r--r-----.  1 root root   4029 Jul 22 19:41 sudoers
    

     vim  进入后提示只有读取的权限。

    ## Allows members of the users group to shutdown this system
    # %users  localhost=/sbin/shutdown -h now
    -- INSERT -- W10: Warning: Changing a readonly file  

    给文件 sudoers  授权 读写的权限:chmod 640  /etc/sudoers

    -rw-r-----.  1 root root   4029 Jul 22 19:41 sudoers

    找到root 用户那行

    ## Allow root to run any commands anywhere 
    root    ALL=(ALL)       ALL
    hadoop  ALL=(ALL)       ALL

    hadoop 是我新添加的用户,保存

    然后再将文件修改成 只有读取的权限 :chmod 440 /etc/sudoers

  • 相关阅读:
    U-Boot新手入门
    安装交叉编译工具
    Makefile 工程管理
    gcc基本用法
    poj 3264 Balanced Lineup
    hdoj 1166 敌兵布阵
    poj 1363 Rails
    poj 1028 Web Navigation
    zoj 3621 Factorial Problem in Base K
    poj1861最小生成树
  • 原文地址:https://www.cnblogs.com/zhanggl/p/3862481.html
Copyright © 2011-2022 走看看