给普通用户添加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 ...
随机推荐
- (转)Spring Boot 2 (十):Spring Boot 中的响应式编程和 WebFlux 入门
http://www.ityouknow.com/springboot/2019/02/12/spring-boot-webflux.html Spring 5.0 中发布了重量级组件 Webflux ...
- xss攻击(跨站脚本)
原理跨站脚本(Cross site script,简称xss)是一种“HTML注入”,由于攻击的脚本多数时候是跨域的,所以称之为“跨域脚本”. 我们常常听到“注入”(Injection),如SQL注入 ...
- 经典Python进阶文档 真的很棒
https://docs.pythontab.com/interpy/args_kwargs/README/
- 二、Oracle 数据库基本操作
一.oracle常用数据类型数字:number(p,s) p表示数字的长度包括小数点后的位数,s表示小数点后的位数固定长度字符:char(n):n表示最大长度,n即是最大也是固定的长度,当数据不满长度 ...
- Consul在.Net Core中初体验
Consul在.Net Core中初体验 简介 在阅读本文前我想您应该对微服务架构有一个基本的或者模糊的了解 Consul是一个服务管理软件,它其实有很多组件,包括服务发现配置共享键值对存储等 本文主 ...
- Ubuntu 14.04 LTS 安装 NVIDIA 显卡驱动后的屏幕亮度调节问题
安装 Ubuntu,对于 NVIDIA 显卡,默认情况下会使用第三方开源驱动,并且一般情况下,第三方开源驱动和系统兼容性更好.由于 NVIDIA 显卡驱动不是开放的,所以对 Linux 系统的原生支持 ...
- Luogu P1776 宝物筛选_NOI导刊2010提高(02)(多重背包模版)
传送门 多重背包板子题, 多重背包就是每种东西有好几个,可以把它拆分成一个一个的01背包 优化:二进制拆分(拆成1+2+4+8+16+...) 比如18=1+2+4+8+3,可以证明18以内的任何数都 ...
- Mysql数据库表被锁定处理
1.查进程,查找被锁表的那个进程的ID show processlist; command 为waitting的就是锁住的表,info为执行某条语句的信息,id为进程. 2.kill掉锁表的进程ID ...
- WPF touch Scroll -触摸滚动
借鉴地址:http://matthamilton.net/touchscrolling-for-scrollviewer 改造后支持上下和左右鼠标拖动滚动: using System; using S ...
- Ubuntu脚本修改IP信息
#!/bin/bash cd /etc/network #清除4-9行 sed -i '4,9d' interfaces #在第3行添加网卡名称 sed -i "3a auto ${1}&q ...