一、用户怎样获得root权限:

1. 进入terminal

2. 输入sudo  passwd root   并设置password,提示要你输入两次password。自己设定password,一定要记住,然后切换到root使用

3. 输入 su root。 要求你输入password,然后输入刚才设定的password回车就进去了

4. 假设不想切换root可是想拥有大部分root权限,能够在使用命令时候加上sudo。

sudo mount挂载

sudo 命令

......

another

假设你想在linux上切换用户。那么输入 su  + username就OK了,他会要求你输入password



二、用户怎样获得永久root权限

1. 加入用户,首先用adduser命令加入一个普通用户。命令例如以下: #adduser tommy //加入一个名为tommy的用户

#passwd tommy //改动password

Changing password for user tommy.

New UNIX password: //在这里输入新密码

Retype new UNIX password: //再次输入新密码

passwd: all authentication tokens updated successfully.

2. 赋予root权限

方法一:改动/etc/sudoers 文件。找到以下一行,把前面的凝视(#)去掉

## Allows people in group wheel to run all commands

%wheel ALL=(ALL) ALL

然后改动用户。使其属于root组(wheel),命令例如以下:

#usermod -g root tommy

改动完成,如今能够用tommy帐号登录,然后用命令 su - ,就可以获得root权限进行操作。

方法二:改动/etc/sudoers 文件,找到以下一行。在root以下加入一行,例如以下所看到的:

## Allow root to run any commands anywhere

root ALL=(ALL) ALL

tommy ALL=(ALL) ALL

改动完成,如今能够用tommy帐号登录,然后用命令 su - ,就可以获得root权限进行操作。

方法三:改动/etc/passwd 文件。找到例如以下行。把用户ID改动为 0 ,例如以下所看到的:

tommy:x:500:500:tommy:/home/tommy:/bin/bash改动后例如以下tommy:x:0:500:tommy:/home/tommy:/bin/bash

保存。用tommy账户登录后。直接获取的就是root帐号的权限。

友情提醒:尽管方法三看上去简单方便。但一般不推荐使用,推荐用法二。



三、配置root登录

Ubuntu 13.10默认是不同意使用root登录的,要想使用root权限,就必须使用  sudo 命令来运行。非常繁琐。

要解决问题,须要两个步骤:

1. 设置rootpassword,开启root账号

ubuntu默认的rootpassword据说是每隔5min就自己主动变换一次。因此首先须要改动rootpassword,设为固定值:

$sudo passwd root

依据提示两次输入新的password就可以,这个时候就能够使用root登录;

登录方式: $su  或者 su root 或者 sudo  -s

然后依据提示输入password就可以在终端用root登录;

2. 改动lightdm配置

打开root登陆。改动 /etc/lightdm/lightdm.conf.d/10-ubuntu.conf 文件

(貌似改动 50-unity-greeter.conf 或其它几个配置文件也行,没试过。有兴趣的能够试试。

)

vim  /etc/lightdm/lightdm.conf.d/10-ubuntu.conf

加入:greeter-show-manual-login=true

allow-guest=true

ubuntu10.04版本号的是改动 /etc/lightdm/lightdm.conf文件

说明:greeter-show-manual-login=true    #同意手工输入登陆系统的username和password

allow-guest=true  #同意guest登录。能够依据自己的须要改动

保存后重新启动,就能够通过输入usernameroot登陆了

Ubuntu 13.10上用户怎样获得root权限,用户怎样获得永久root权限,假设配置root登录的更多相关文章

  1. Ubuntu 13.10 安装Qt5

    Qt5在Ubuntu的软件中心是找不到的,只能从Qt的官网下载安装. http://qt-project.org/downloads,选择完整的Linux版本(qt-linux-opensource- ...

  2. Ubuntu 13.10 安装 Unity 8 试用截图

    关于 Unity 8 有很多报道,Unity 8 相对于 Unity 7 变化相当大,这是 Ubuntu 团队打造的一款通用于 PC.手机.平板的桌面. Unity 8 已经登陆 ubuntu 13. ...

  3. ubuntu 13.10 mono asp.net服务 安装

    ubuntu 13.10 从官方文档http://www.mono-project.com/Mod_mono 可看到 Mod_Mono is an Apache 2.0/2.2/2.4.3 modul ...

  4. 如何在Ubuntu 14.10 上安装WordPress?

    http://codex.wordpress.org/zh-cn:安装WordPress 介绍 如果你想快捷.简单.免费的创建个人网站的话,WordPress 是你最佳的选择. WordPress 是 ...

  5. ubuntu 13.10 amd64安装ia32-libs

    很多软件只有32位的,有的依赖32位库还挺严重的:从ubuntu 13.10已经废弃了ia32-libs,但可以使用多架构,安装软件或包apt-get install program:i386.有的还 ...

  6. ubuntu 13.10 install wireshark

    ubuntu 13.10 install wireshark 今天在使用java jsoup操作remote server的是否,在本地执行可以成功返回内容,然后打成jar包,使用shell在 ser ...

  7. ubuntu 12.10上安装tftpd-hpa

    ubuntu 12.10上安装tftpd-hpa 1)安装tftp-hpa,tftpd-hpa sudo apt-get install tftp-hpa tftpd-hpa tftp-hpa是cli ...

  8. Qt Creator 调试器 在 Ubuntu 13.10下 局部变量和表达式(Locals) 无内容

    此篇算是一个翻译,万一有国内同样的小白遇到同样问题,方便参考. 原文http://hostilefork.com/2013/10/20/qtcreator-debugger-no-locals-ubu ...

  9. ubuntu 13.10 monodevelop3 安装

    版本 ubuntu 13.10 桌面模式默认:unity :文件管理器:nautilus

随机推荐

  1. RestAssured打印日志到文件中的方法

    参考https://stackoverflow.com/questions/14476112/how-to-get-rest-assured-log-into-something-printable- ...

  2. 【CF659E】New Reform(图的联通,环)

    分析转载自http://blog.csdn.net/yukizzz/article/details/51029628 题意: 给定n个点和m条双向边,将双向边改为单向边,问无法到达的顶点最少有多少个? ...

  3. poj 2318 TOYS 点与矩形的关系

    题目链接 题意 有一个矩形盒子,\(n(n\leq 5e4)\)条线段将其分成了\(n+1\)个区域(每条线段的两个端点分别在矩形的上边和下边,且线段互不相交).现向盒子中扔\(m(m\leq 5e4 ...

  4. 数据结构自己实现——stack

    #define StackSize 100 typedef char DataType; class stack { public: DataType data[StackSize]; int top ...

  5. cookies-判断用户是否是第一次进入页面

    在郑州美莱的活动项目中客户当时有提到该需求.尽管最后去掉了该需求,但是还是花了我不少时间研究,因为之前的项目我前端没有用到过cookies,吓死宝宝了 $(document).ready(functi ...

  6. css-通过css让块显示或隐藏

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  7. R语言实战读书笔记(六)基本图形

    #安装vcd包,数据集在vcd包中 library(vcd) counts <- table(Arthritis$Improved)counts # 垂直barplot(counts, main ...

  8. http错误种类及原因

    http://blog.csdn.net/dxykevin/article/details/50950878 [摘要]HTTP状态码(HTTP Status Code)是用以表示网页服务器HTTP响应 ...

  9. LightOj 1215 Finding LCM

    Discription LCM is an abbreviation used for Least Common Multiple in Mathematics. We say LCM (a, b, ...

  10. Android在其他线程中更新UI

    public class TransferTools { private static final int MSG_START = 1001; private static final int MSG ...