给用户root权限
2024-10-15 18:07:46
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 successfully.
- 2
2、 修改 /etc/sudoers 文件,找到下面一行,把前面的注释(#)去掉
## Allows people in group wheel to run all commands
%wheel ALL=(ALL) ALL
然后修改用户,使其属于root组(wheel),命令如下
#usermod -g root tommy
- 3
赋予root权限
修改/etc/sudoers 文件,找到下面一行,在root下面添加一行:
##Allow root to ruan any commands anywhere
root ALL=(ALL) ALL
tommy ALL=(ALL) ALL
修改完毕,现在可以用tommy帐号登录,然后用命令 su - ,即可获得root权限进行操作。
最新文章
- RPM包管理命令rpm
- MySQL 数据库的导入 导出
- MicroPHP 2.2.0 发布
- 笔记(一):ES6所改良的javascript“缺陷”
- Quartz.Net 作业调度后台管理系统,基于Extjs
- 使用MySQL索引的几个问题
- iOSpush过后返回多级界面
- python-selenium实现的简易下载器,并常见错误解决
- Android数据库升级、降级、创建(onCreate() onUpgrade() onDowngrade())[4]
- python学习之路-2 初识python数据类型
- Windows下命令行下启动ORACLE服务
- centos 7用ss命令来查看端口占用和对应进程
- find、findIndex、indexOf、lastIndex、includes 数组五种查询条件方法介绍
- Linux学习(1)-常用快捷键、文件管理和查询
- 数据库之Oracle——初级
- UnicodeEncodeError: 'gbk' codec can't encode character '\xa0' in position 1987: illegal multibyte sequence
- 2013 QCon北京演讲:跨终端的WebKit渲染机制
- AngularJS学习笔记之directive——scope选项与绑定策略
- #研发解决方案#研发协作平台CloudEngine
- go基础系列:简介
热门文章
- Python学习-字典练习:简单通讯录
- cv.Mat 与 .txt 文件数据的读写操作
- Mac OS上搭建LNMP开发环境
- Hibernate One-to-One Mappings 一对一关系映射
- traits编程---萃取容器中迭代器的类型等
- 1.Python3关于文件的操作
- CentOS 6.5 下MySql主从、主主配置
- Codeforces Round #204 (Div. 2) C. Jeff and Rounding——数学规律
- (转)将rdlc报表作为资源嵌套使用
- CRUD