rhel7 配置普通用户使用sudo
rhel服务器版本安装之后,默认创建的用户不能使用sudo。使用sudo,会提示 user1 is not in the sudoers file. This incident will be reported.
解决方法(比如创建的用户叫做user1, 密码user1pass):
1、直接运行visudo命令,或者vim /etc/sudoers 。 打开并编辑/etc/sudoers文件:
visudo
或者
vim /etc/sudoers
2、找到下边代码的位置,并删除第二行的 ‘#’
## Allows people in group wheel to run all commands
# %wheel ALL=(ALL) ALL
3、用root身份运行:
usermod -aG wheel user1
4、切换到user1用户,并查看是否已经属于wheel组:
su - user1
groups
如果显示为:
user1 wheel
即表示成功。
5、测试:
sudo whoami
显示类似下边代码即表明可以正常使用sudo:
$ sudo whoami
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 USERNAME:
root
完毕。
rhel7 配置普通用户使用sudo的更多相关文章
- inux设置普通用户无密码sudo权限
配置普通用户无密码sudo权限: root用户进入到Linux系统的/etc目录下 cd /etc 将sudoers文件赋予写的权限 chmod u+w /etc/sudoers 编辑sudoers文 ...
- Linux设置普通用户无密码sudo权限
配置普通用户无密码sudo权限: root用户进入到Linux系统的/etc目录下 cd /etc 将sudoers文件赋予写的权限 chmod u+w /etc/sudoers 编辑sudoers文 ...
- 将用户赋予sudo权限:配置sudoers文件
xxx is not in the sudoers file.This incident will be reported.的解决方法 1.切换到root用户下,怎么切换就不用说了吧,不会的自己百 ...
- Centos6.4 为用户添加sudo功能
sudo即super user do,以超级管理员的方式运行命令.使用时,只需在命令最前面加上sudo即可. 要为用户添加sudo功能,需要修改sudo的配置文件: vi /etc/sudoers ( ...
- unbuntu下的root 用户和 sudo 命令
参考: http://james23dier.iteye.com/blog/721246 http://blog.csdn.net/shichexixi/article/details/5969993 ...
- linux下添加用户到sudo组 并禁止sudo用户修改密码
linux下添加用户到sudo组 创建用户 useradd hanli 为新用户设置密码 passwd hanli 创建用户组 groupadd op 将用户添加到用户组 usermod - ...
- RHEL7配置中文输入法-智能拼音
RHEL7配置中文输入法-智能拼音 RHEL7.x(CentOS7.x)系统相对之前的6.x系统变化较大,虽然安装时选择了中文环境,但是进入系统后,在控制台及编辑器中仍无法切换输入法进行中文输入. 原 ...
- 给普通用户加sudo权限
系统环境:centos 7.0 引文:在实验室的服务器上给每个人分配了一个账号,但是有的时候普通用户需要使用root权限,比如装一些软件之类的.下面介绍怎么给普通用户添加sudo命令权限. 前提: s ...
- ubuntu下怎么给普通用户赋予sudo权限
ununtu系统安装过程中,系统会提示建立一个默认用户,比如用户名为:zhuhui.这个默认用户具有一定的管理功能,即可以通过sudo命令执行root权限的操作.由于Ubuntu系统默认不允许通过ro ...
随机推荐
- django的models模型类的常用数据类型和选项
django框架的models模块ORM框架,能够让我们通过编写类的方式,帮助我们自动生成数据库表. 生成的数据库表名为 应用模块名称_类名 数据库表中字段名 如果我们没有在参数中指定,就是我们写的类 ...
- c#获取网络时间并同步本地时间
通过TCP形式来获取NTP时间.主要代码如下: [DllImport("kernel32.dll")] private static extern bool SetLocalTim ...
- 如何解释vue的生命周期才能令面试官满意?
当面试官问:"谈谈你对vue的生命周期的理解",听到这句话你是不是心里暗自窃喜:这也太容易了吧,不就是beforeCreate.created.beforeMount.mounte ...
- LinkedHashMap简明
LinkedHashMap 构造方法摘要 inkedHashMap() 构造一个带默认初始容量 (16) 和加载因子 (0.75) 的空插入顺序LinkedHashMap 实例. LinkedHash ...
- ubuntu安装eclipse
官网下载界面 这里我选择的是Exlipse Oxygen的Eclipse IDE for Java EE Developers的64位版本. IBM直接下载地址 下载下来的是一个tar.gz的安装包, ...
- [LeetCode] Minimum Window Subsequence 最小窗口序列
Given strings S and T, find the minimum (contiguous) substring W of S, so that T is a subsequence of ...
- Scrapy选择器的用法
1.构造选择器: >>> response = HtmlResponse(url='http://example.com', body=body) >>> Sele ...
- 每天记录一点:NetCore获得配置文件 appsettings.json
用NetCore做项目如果用EF ORM在网上有很多的配置连接字符串,读取以及使用方法 由于很多朋友用的其他ORM如SqlSugar,NH,Dapper等,在读取连接字符串的时候,往往把信息保存到一 ...
- Linux(七)开机,重启和用户登录注销
7.1 关机&重启命令 基本介绍: shutdown -h now 立刻进行关机 shutdown -h 1 1分钟后关机 shutdown -r now ...
- Linear Regression with Scikit Learn
Before you read This is a demo or practice about how to use Simple-Linear-Regression in scikit-lear ...