1. 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

    2、 修改 /etc/sudoers 文件,找到下面一行,把前面的注释(#)去掉

    ## Allows people in group wheel to run all commands

    %wheel    ALL=(ALL)    ALL

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

    #usermod -g root tommy

  3. 3

    赋予root权限

    修改/etc/sudoers 文件,找到下面一行,在root下面添加一行:

    ##Allow root to ruan any commands anywhere

    root  ALL=(ALL)    ALL

    tommy    ALL=(ALL)    ALL

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

最新文章

  1. RPM包管理命令rpm
  2. MySQL 数据库的导入 导出
  3. MicroPHP 2.2.0 发布
  4. 笔记(一):ES6所改良的javascript“缺陷”
  5. Quartz.Net 作业调度后台管理系统,基于Extjs
  6. 使用MySQL索引的几个问题
  7. iOSpush过后返回多级界面
  8. python-selenium实现的简易下载器,并常见错误解决
  9. Android数据库升级、降级、创建(onCreate() onUpgrade() onDowngrade())[4]
  10. python学习之路-2 初识python数据类型
  11. Windows下命令行下启动ORACLE服务
  12. centos 7用ss命令来查看端口占用和对应进程
  13. find、findIndex、indexOf、lastIndex、includes 数组五种查询条件方法介绍
  14. Linux学习(1)-常用快捷键、文件管理和查询
  15. 数据库之Oracle——初级
  16. UnicodeEncodeError: 'gbk' codec can't encode character '\xa0' in position 1987: illegal multibyte sequence
  17. 2013 QCon北京演讲:跨终端的WebKit渲染机制
  18. AngularJS学习笔记之directive——scope选项与绑定策略
  19. #研发解决方案#研发协作平台CloudEngine
  20. go基础系列:简介

热门文章

  1. Python学习-字典练习:简单通讯录
  2. cv.Mat 与 .txt 文件数据的读写操作
  3. Mac OS上搭建LNMP开发环境
  4. Hibernate One-to-One Mappings 一对一关系映射
  5. traits编程---萃取容器中迭代器的类型等
  6. 1.Python3关于文件的操作
  7. CentOS 6.5 下MySql主从、主主配置
  8. Codeforces Round #204 (Div. 2) C. Jeff and Rounding——数学规律
  9. (转)将rdlc报表作为资源嵌套使用
  10. CRUD