给普通用户添加root权限
>>提君博客原创 http://www.cnblogs.com/tijun/ <<
第一步,以root用户查看/etc/sudoers
[root@ltt2 hadoop]# ls -l /etc/sudoers
-r--r-----. root root Sep : /etc/sudoers
发现这个文件只读文件,将其更改成可写状态
[root@ltt2 hadoop]# chmod /etc/sudoers
[root@ltt2 hadoop]# ls -l /etc/sudoers
-rwxrwxrwx. root root Sep : /etc/sudoers
第二步,添加内容到文件内
[root@ltt2 hadoop]# vi /etc/sudoers
..
..
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
hadoop ALL=(ALL) ALL
..
..
再将文件改为只读
[root@ltt2 bin]# chmod /etc/sudoers
[root@ltt2 bin]# ls -l /etc/sudoers
-r--r-----. root root Sep : /etc/sudoers
切换普通用户,就可以用sudo命令了
[root@ltt2 bin]# su hadoop
[hadoop@ltt2 bin]$ sudo shutdown -h now We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things: #) Respect the privacy of others.
#) Think before you type.
#) With great power comes great responsibility. [sudo] password for hadoop: Broadcast message from hadoop@ltt2.bg.cn
(/dev/pts/) at : ... The system is going down for halt NOW!
>>提君博客原创 http://www.cnblogs.com/tijun/ <<
给普通用户添加root权限的更多相关文章
- linux普通用户添加root权限
新增一个普通用户并进入该用户: [root@VM_0_7_centos ~]# groupadd mall [root@VM_0_7_centos ~]# useradd mall -m -d /ho ...
- 嵌入式环境:CentOS下添加用户并且让用户获得root权限
CentOS下添加用户并且让用户获得root权限 http://www.centoscn.com/CentOS/config/2014/0810/3471.html 1.添加用户,首先用adduser ...
- Linux系统下给非root用户添加sudo权限
Linux系统下给非root用户添加sudo权限 有时,在linux系统中非root用户运行sudo命令,会提示类似信息: xxx is not in the sudoers file. This ...
- Linux给用户添加sudo权限
一.linux给用户添加sudo权限: 有时候,linux下面运行sudo命令,会提示类似: xxxis not in the sudoers file. This incident will be ...
- centos 普通用户添加sudo权限
本文介绍下,在centos中为普通用户添加sudo权限的方法,供大家学习参考. 在centos中为普通用户增加sudo权限的简单方法,大家参考下. 1,修改/etc/sudoers文件,必须为visu ...
- Linux中给普通用户添加sudo权限
使用Linux系统时,经常会被要求使用超级权限,但是root的权限太过大了,一般慎用!!!因此可以通过给普通用户添加sudo权限,平常用普通用户进行操作,当需要root权限的时候进行sudo操作.以下 ...
- 04.给linux用户添加sudo权限
linux给用户添加sudo权限: 有时候,linux下面运行sudo命令,会提示类似: xxxis not in the sudoers file. This incident will be r ...
- Linux学习笔记之如何让普通用户获得ROOT权限
在学习sodu的时候,我发现一些命令只能由root用户使用,普通用户使用会提示此用户没有使用sudo的权限.我想到的解方法是把正在使用的普通用户获得root权限,于是我通过百度和询问老师知道了如何去实 ...
- 【debian】给用户添加sudo权限
新装的debian系统默认是没有sudo功能的. 于是,在root用户权限下: apt-get install sudo 然后再修改文件 /etc/sudoers : chmod +w /etc/su ...
随机推荐
- VBA果然很强大
1.我的是office 2007,新建空白文档-开发工具 -visual basic -project -thisDocument - Document_Open ,写入以下代码(并另存为word ...
- 转://Oracle 单引号转义
在ORACLE中,单引号有两个作用: 1:字符串是由单引号引用 2:转义. 单引号的使用是就近配对,即就近原则.而在单引号充当转义角色时相对不好理解 1.从第二个单引号开始被视为转义符,如果第二个单引 ...
- 发现一款比echarts更牛B,效果更炫的图表组件 d3.js
每天学习一点点 编程PDF电子书.视频教程免费下载:http://www.shitanlife.com/code d3.js ,能制作更加复杂的图表 https://github.com/d3/d3 ...
- js如何获取跨域iframe 里面content
每天学习一点点 编程PDF电子书.视频教程免费下载:http://www.shitanlife.com/code 其中src可能存在跨域. 现有的获取方式 var test = document. ...
- D. Zero Quantity Maximization(hash+map)
题意:就是让c=a*x+b,给你一个a[],b[],让你尽可能多的让c[]=0,输出有多少. 思路:直接令c=0,则x=-b/a, 也就是一条直线,通过这样就用hash值使相同的k值映射到一起,使用了 ...
- 小a的轰炸游戏 (差分)
我是看题解的! 这道题还是有很多细节,当然,是一道差分的好题! 题意:有2种飞机,一种是只炸上半菱形,一种是炸整个菱形.问所有区域内的所有格子的异或和. 思路:用前缀和思路: 这样遍历过去就完成了一次 ...
- 【js】项目中遇到的零星知识点
1.将进行url编码的json字符串转成json对象 在解析为json对象之前,要先用decodeURIComponent(str)来进行解码,然后这json串又变成了我们原先的json串了.然后我们 ...
- Spring Security(二十五):7. Sample Applications
There are several sample web applications that are available with the project. To avoid an overly la ...
- E:dpkg was interrupted, you must manually run'dpkg配置'to correct the problem.
执行sudo apt-get install安装对应的软件出现如下错误 详细错误信息: E: Could not : Resource temporarily unavailable) E: Unab ...
- mysql远程连接 Host * is not allowed to connect to this MySQL server
mysql -u root -p mysql>use mysql; mysql>update user set host =’%'where user =’root’; mysql> ...