Centos root权限修改

方法一:修改 /etc/sudoers 文件,

找到下面一行,把前面的注释(#)去掉

## Allows people in group wheel to run all commands

%wheel    ALL=(ALL)    ALL

然后修改用户,使其属于root组(wheel),

命令如下:

#usermod -g root devuser

修改完毕,现在可以用tommy帐号登录,然后用命令 su – ,即可获得root权限进行操作。

方法二:修改 /etc/sudoers 文件,

找到下面一行,在root下面添加一行,

如下所示:

## Allow root to run any commands anywhere

root    ALL=(ALL)     ALL

devuser   ALL=(ALL)     ALL

修改完毕,现在可以用devuser帐号登录,然后用命令 sudo – ,即可获得root权限进行操作。

方法三:修改 /etc/passwd 文件,

找到如下行,把用户ID修改为 0 ,

如下所示:

devuser:x:0:33:devuser:/data/webroot:/bin/bash

Centos root权限修改

时间: 2024-08-29 19:58:36

Centos root权限修改的相关文章

dsm winscp 获得 root 权限修改上传文件

使用DSM开了ssh只可以用admin登陆scp没有权限上传文件.可以用以下方法. ssh 登陆 dsm sudo -i  取得root权限 修改 /etc/sudoers 文件中 %administrators ALL=NOPASSWD:ALL     (无修改权可用 chmod +w /etc/sudoers) 打开winscp 编辑会话 点 高级 修改shell 添加 sudo -i 保存 ->登陆(完) 原文地址:https://www.cnblogs.com/yangjig/p/100

centos用户权限修改

一.出现问题的原因 今天安装了centos6.5的系统,是装的图形界面.但是又不想重装成mini版.所有就准备修改系统问题,让系统开机自动进入命令模式. 二.错误提示 登录的是普通用户,修改/etc/inittab 文件 最后一行默认是: id:5:initdefault:     #默认进入图像界面 只要将5修改成3即可开机自动进入密令行模式. 但是修改保存时收到提示: xxx is not in the sudoers file.  This incident will be reporte

Centos root权限的变化

方法一:更改 /etc/sudoers 文件, 找到以下一行,把前面的凝视(#)去掉 ## Allows people in group wheel to run all commands %wheel    ALL=(ALL)    ALL 然后改动用户,使其属于root组(wheel), 命令例如以下: #usermod -g root devuser 改动完成,如今能够用tommy帐号登录,然后用命令 su – .就可以获得root权限进行操作. 方法二:改动 /etc/sudoers 文

Ubuntu Root 权限修改

给用户root权限

1.添加用户,首先用adduser命令添加一个普通用户,命令如下: #adduser tommy //添加一个名为tommy的用户#passwd tommy   #passwd tommy //修改密码 Changing password for user tommy. New UNIX password:     //在这里输入新密码 Retype new UNIX password:  //再次输入新密码 passwd: all authentication tokens updated s

嵌入式环境:CentOS下添加用户并且让用户获得root权限

CentOS下添加用户并且让用户获得root权限 http://www.centoscn.com/CentOS/config/2014/0810/3471.html 1.添加用户,首先用adduser命令添加一个普通用户,命令如下:  #adduser tommy //添加一个名为tommy的用户#passwd tommy   //修改密码Changing password for user tommy.New UNIX password:     //在这里输入新密码Retype new UN

CentOS下添加用户并且让用户获得root权限

修改 /etc/sudoers 文件,找到下面一行,在root下面添加一行,如下所示: ## Allow root to run any commands anywhereroot    ALL=(ALL)     ALLtom   ALL=(ALL)     ALL 修改完毕,现在可以用tom帐号登录,然后用命令 su - ,即可获得root权限进行操作. ---------------------------------------------------------------------

linux下非root用户如何修改root权限的文件

在linux下会出现把一些配置文件参数配错.root密码忘记等导致系统无法启动或进入root的窘迫境地,本文以redhat  enterprise linux server 6.4为例介绍root身份修改root权限配置文件的参数后,root无法登录,然后通过linux的rescue模式改回配置文件,巧妙以非root身份修改了root权限的文件的解决方案. 首先,插入linux安装盘重启系统,等到引导进入安装会话,上下移动方向键,选rescue installed system: 第二,进入修复

CentOS 7下新建用户并设置为可提升为ROOT权限

第一步:添加用户 命令: #adduser tom    <!--此处以用户tom为例--> 第二步:修改密码 命令: #passwd tom 根据提示输入两次密码,完成密码设置. 第三步:设置用户权限 方法一:修改 /etc/sudoers 文件(推荐方法) 命令: #visudo    <!--找到下面一行,并在其后新增一行,如下所示:--> ## Allow root to run any commands anywhere    root    ALL=(ALL)