Ubuntu 13.10上用户如何获得root权限,用户如何获得永久root权限,如果配置root登录

一、用户如何获得root权限:

1. 进入terminal

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

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

4. 如果不想切换root但是想拥有大部分root权限,可以在使用命令时候加上sudo,

sudo mount挂载

sudo 命令

......

another

如果你想在linux上切换用户,那么输入 su  + 用户名就OK了,他会要求你输入密码

二、用户如何获得永久root权限

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

#passwd tommy //修改密码

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. 设置root密码,开启root账号

ubuntu默认的root密码据说是每隔5min就自动变换一次,因此首先需要修改root密码,设为固定值:

$sudo passwd root

根据提示两次输入新的密码即可,这个时候就可以使用root登录;

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

然后根据提示输入密码即可在终端用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    #允许手工输入登陆系统的用户名和密码

allow-guest=true  #允许guest登录,可以根据自己的需要修改

保存后重启,就可以通过输入用户名root登陆了

Ubuntu 13.10上用户如何获得root权限,用户如何获得永久root权限,如果配置root登录

时间: 2024-07-30 04:15:50

Ubuntu 13.10上用户如何获得root权限,用户如何获得永久root权限,如果配置root登录的相关文章

ubuntu 13.10 编译安装conkeror

conkeror几年前我用过,还是一个不错的浏览器,这次因为笔记本只支持Ubuntu 13.10, 而不支持更新版本,就尝试着在Ubuntu 13.10上安装最新conkeror,但是没想到居然没有安装源.于是就编译吧, 当然还是要首先clone到源代码: git clone git://repo.or.cz/conkeror.git 然后根据官方文档的提示: To build your own Conkeror package, install fakeroot, quilt, and deb

[转载]Deploying Python with uWSGI and Nginx on Ubuntu 13.10

http://perlmaven.com/deploying-pyton-with-uwsgi-on-ubuntu-13-10 The following is a tutorial on how to set up uWSGI with an Nginx front end to server simple Python scripts. In this tutorial we will only use the packages that are supplied by Ubuntu. It

如何在Ubuntu 14.10 上安装WordPress?

http://codex.wordpress.org/zh-cn:安装WordPress   介绍 如果你想快捷.简单.免费的创建个人网站的话,WordPress 是你最佳的选择. WordPress 是一种使用 PHP语言开发的博客平台,用户可以在支持 PHP 和 MySQL数据库的服务器上架设属于自己的网站.也可以把  WordPress 当作一个内容管理系统( CMS )来使用. WordPress 是一款个人博客系统,并逐步演化成一款内容管理系统软件,它是使用 PHP 语言和 MySQL

Ubuntu 13.10装好系统后大配置

安装后的配置,尽量按顺序来吧. 1. 更改软件源 习惯性的改163源了. 软件和更新 -> 下载自 -> 其他站点,http://mirrors.163.com/ubuntu. 顺道顶栏Tab菜单,其它软件,附加驱动,该勾的勾上. 2. update & upgrade 1 sudo apt-get update && sudo apt-get upgrade 3. gnome3   sudo apt-get install gnome-shell 注销,在登录界面选择

在Ubuntu 12.10上安装VirtualBox

首先,根据以下官方指引进行安装: https://www.virtualbox.org/wiki/Linux_Downloads 因此,根据你的操作系统的版本号在/etc/apt/sources.list添加以下记录: deb http://download.virtualbox.org/virtualbox/debian trusty contrib deb http://download.virtualbox.org/virtualbox/debian saucy contrib deb h

【转】Install SmartGit via PPA in Ubuntu 13.10/13.04/12.04/Linux Mint

原文网址:http://ubuntuhandbook.org/index.php/2013/09/install-smartgit-via-ppa-ubuntu-linux-mint/ This tutorial will show you how to install SmartGit/HG easily via PPA in Ubuntu 13.10, Ubuntu 13.04, Ubuntu 12.04, Ubuntu 12.10 and Linux Mint. As you may kn

ubuntu 13.10 Rhythmbox不能播放mp3 和中文乱码的问题

1.ubuntu 13.10 Rhythmbox不能播放mp3的解决方法 软件中心搜索(ubuntu额外的版权受限软件)不带括号 2.中文乱码问题解决方法: 终端顺序操作 : 1.  sudo gedit ~/.profile 2. 文件最后加入以下内容 export GST_ID3_TAG_ENCODING=GBK:UTF-8:GB18030 export GST_ID3V2_TAG_ENCODING=GBK:UTF-8:GB18030 保存退出 3. source ~/.profile 4.

Installing teamviewer 9 on 64-bit Ubuntu 13.10 (转载)

While trying to install Teamviewer 9 on 64-bit Ubuntu 13.10, you’ll get a dependencies error such as this: Unpacking teamviewer (from teamviewer_linux_x64.deb) ... dpkg: dependency problems prevent configuration of teamviewer:  teamviewer depends on

Fix invisible cursor issue in Ubuntu 13.10

Fix invisible cursor issue in Ubuntu 13.10 Fixing this problem is rather too easy. Open a terminal (Ctrl+Alt+T) and use the following command: gsettings set org.gnome.settings-daemon.plugins.cursor active false You'll have to work a bit to copy this