centos用户权限修改

centos用户权限修改

1、出现问题的缘由vim

    今天安装了centos6.5的系统,是装的图形界面。可是又不想重装成mini版。全部就准备修改系统问题,让系统开机自动进入命令模式。centos

2、错误提示ide

    登陆的是普通用户,修改/etc/inittab 文件spa

    最后一行默认是:3d

    id:5:initdefault:     #默认进入图像界面blog

    只要将5修改为3便可开机自动进入密令行模式。ci

    可是修改保存时收到提示:get

    xxx is not in the sudoers file.  This incident will be reported。it

3、解决办法登录

   修改/etc/sudoers文件。普通用户是没法修改这个文件的,需切换成root用户。

    一、/etc/sudoers 文件是只读文件,需先修改文件权限属性

    chmod u+w /etc/sudoers

    二、vim /etc/sudoers,找到以下信息:   

    ## Allow root to run any commands anywhere

    root    ALL=(ALL)     ALL

    在root下添加一行,其中leo为你的用户名。修改完wq保存退出。

    leo   ALL=(ALL)     ALL

    三、修改完后取消写权限

    chmod u-w /etc/sudoers

四:修改完后你用su - 便可得到root权限(su 用户名 #切换用户)

相关文章
相关标签/搜索