为了安全起见,ubuntu中的普通用户一般没有root权限,因此即使知道管理员密码也无法使用sudo,但这个情况可以通过加入sudoer列表或者加入sudo组来改变。

拓展:

不管使用哪种方式,使得一个普通用户可以使用sudo命令,都必须先切换到管理员root用户中,或者切换到可以使用sudo的用户中。

1,加入sudoer列表的做法:

第一步,执行sudo visudo,找到root ALL=(ALL:ALL) ALL这一行,在这一行下面照抄一遍,将root改成你要设置的用户名即可,比如:

vincent ALL=(ALL:ALL) ALL

按ctrl + o写入,注意此时系统提示自动写入/etc/sudoes.tmp,要将sudoers.tmp改成sudoers,即删除.tmp,然后按回车,然后输入y确认你的操作。

按ctrl + x退出,搞定。

2,加入sudo组的做法:

一句命令搞定:sudo usermod vincent -a -G sudo

Ubuntu add sudo的更多相关文章

  1. ubuntu的sudo免密

    ubuntu的sudo免密与centos大同小异,都是在/etc/sudoers中添加用户信息,添加的内容也一样,只是位置不一样. centos的位置如下: 而ubuntu的位置如下: 除此之外,两行 ...

  2. 【linux开发】ubuntu执行sudo apt-get update提示缺少公钥

    ubuntu执行sudo apt-get update提示缺少公钥 提示信息如下: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 获取:1 http://arch ...

  3. Ubuntu用sudo apt-get update出错:E: Problem executing scripts APT::Update::Post-Invoke-Success

    Ubuntu用sudo apt-get update出错:   E: Problem executing scripts APT::Update::Post-Invoke-Success 'if /u ...

  4. ubuntu创建sudo 用户

    The sudo command provides a mechanism for granting administrator privileges, ordinarily only availab ...

  5. ubuntu su sudo sudo–i 区别

    sudo : 暂时切换到超级用户模式以执行超级用户权限,提示输入密码时该密码为当前用户的密码,而不是超级账户的密码.不过有时间限制,Ubuntu默认为一次时长15分钟. su : 切换到某某用户模式, ...

  6. ubuntu执行sudo apt-get update提示缺少公钥

    提示信息如下: 获取:1 http://archive.ubuntukylin.com:10006/ubuntukylin xenial InRelease [3,192 B] 命中:2 http:/ ...

  7. ubuntu add application to launcher

    eg. add sublime text to launcher so as to be found by launcher, docky, etc. add a file sudo gedit /u ...

  8. ubuntu添加sudo权限

    ubuntu有时候没有开通sudo功能,有些操作只能切换到root进行,很不方便. 1.切换到root su root 2.打开suduers文件 gedit /etc/sudoers 3.找到下面这 ...

  9. Ubuntu 取消sudo密码

    需求:在Ubuntu下装了FQ代理goagent之后,为了goagent能够开机启动.因为goagent需要sudo权限,所以要去掉sudo密码. 要修改的文件位于/etc/sudoers,先备份: ...

随机推荐

  1. [poj 2453] An Easy Problem

    An Easy Problem Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 8371   Accepted: 5009 D ...

  2. Node.js + Express中间件详解

    使用中间件 Express是一种路由和中间件Web框架,它具有自己的最小功能:Express应用程序本质上是一系列中间件函数调用. 中间件函数是可以访问请求对象 (req),响应对象(res)以及应用 ...

  3. java.sql.SQLException: Parameter index out of range (3 > number of parameters, which is 2).

    java.sql.SQLException: Parameter index out of range (3 > number of parameters, which is 2). java. ...

  4. Qt绘制文本二 弯曲排列和旋转效果 弧形路径 正弦函数路径

    void WgtText::paintEvent(QPaintEvent *event) { QPainter painter(this); QString m_string("abcdef ...

  5. Java获取路径(getResource)

    package com.zhi.test; public class PathTest { public static void main(String[] args) { System.out.pr ...

  6. EXCEL词典(xllex.dll)文件丢失或损坏解决方法

    EXCEL词典(xllex.dll)文件丢失或损坏解决方法     1● 问题   2● 解决 fail 3● 方法2   regsvr32 xllex.dll     4● 方法3 启动server ...

  7. install the Mondo Rescue utility in Ubuntu 12.04 or 12.10.

      1. Open a terminal window. 2. Type in the following commands, then hit Enter after each.   wget ft ...

  8. linux系统管理 vi编辑器

    Vim是vi improved的缩写是vi的改进版本,vi被认为是事实上的标准编辑器 所有版本的Linux都带有vi编辑器 占用的资源少 与ed,ex等其他编辑器相比,vi对用户更加友好 进入vi编辑 ...

  9. weblogic相关

    来源:http://zhidao.baidu.com/link?url=gqPaYovGiEHYPPPyI6PgPV6THVLr4nlj3CGCjY3mwm0-ERUnfuQz614ywAwYLnP6 ...

  10. sql取大的一个值

    select b.*,             a.recid,             a.keyno  from product b,             (select pcode,     ...