有时候, 比如在CentOS 6上. sudo 会报如下错误:

sudo: must be setuid root

这是因为, sudo 命令, 没有SUID,

[root@T209 ~]# ll /usr/bin/sudo
-rwxr-xr-x. root root Jun /usr/bin/sudo

使用如下命令, 增加SUID:

[root@localhost ~]# chmod u+s /usr/bin/sudo
[root@localhost ~]# ll /usr/bin/sudo
-rwsr-xr-x. root root Jun /usr/bin/sudo

参考:https://www.sudo.ws/troubleshooting.html

Q) Sudo compiles and installs OK but when I try to run it I get:
effective uid is not , is /usr/local/bin/sudo on a file system with the
'nosuid' option set or an NFS file system without root privileges?
A) The owner and permissions on the sudo binary appear to be OK but when
sudo ran, the setuid bit did not have an effect. There are two common
causes for this. The first is that the file system the sudo binary
is located on is mounted with the 'nosuid' mount option, which disables
setuid binaries. The output of the "mount" command should tell you if
the file system is mounted with the 'nosuid' option. The other possible
cause is that sudo is installed on an NFS-mounted file system that is
exported without root privileges. By default, NFS file systems are
exported with uid mapped to a non-privileged uid (usually -). You
should be able to determine whether sudo is located on an NFS-mounted
filesystem by running "df `which sudo'".

[daily][centos][sudo] sudo 报错的更多相关文章

  1. centOS下yum报错

    CentOS下yum报错 备注:当我们在CentOS下使用yum命令的时候,会报一些错误,一下是我总结的几个解决问题的方法.(保证自己的服务器可以上网) 一.关于Loaded plugins: fas ...

  2. linux(乌班图)下执行pip没有问题,执行sudo pip报错的问题

    最近刚装好linux的虚拟机,在装一个套件时提示权限不足,于是添加上了 sudo 命令,结果直接报以下错误, Traceback (most recent call last): File " ...

  3. CentOS的MySQL报错:Can't connect to MySQL server

    原文链接: http://www.centoscn.com/CentosBug/softbug/2015/0622/5709.html 问题描述: 使用客户端远程登录连接基于CentOS 6.5服务器 ...

  4. 安装Python3后,centos使用yum报错

    题记 在之前的文章中我自定义安装了Python3,并且修改了默认的 Python软链,今天想搭建一个 ftp 服务器,使用命令的时候出现了一个错误: 问题 1.使用 yum 安装 ftp工具 yum ...

  5. CentOS yum命令报错 Error: File /var/cache/yum/i386/6/epel/metalink.xml does not exist

    最近在虚拟机上执行yum命令一直报错:Could not parse metalink https://mirrors.fedoraproject.org/metalink?repo=epel-7&a ...

  6. 安装CentOS 6.x报错"Disk sda contains BIOS RAID metadata"解决方法

    今天在安装CentOS 6.2的时候,当进到检测硬盘的时候,总是过不去,报错如下: Disk sda contains BIOS RAID metadata, but is not part of a ...

  7. Centos 安装docker报错

    错误信息: 安装报错:Transaction check error:  file /usr/lib/systemd/system/blk-availability.service from inst ...

  8. 【Python】Centos + gunicorn+flask 报错ImportError: No module named request

    今天用Python去下载图片,用到了 urllib.request,这个是python3的方法.python2 使用的是urllib2 遇到了这么个问题后台报错,ImportError: No mod ...

  9. 解决Centos运行yum 报错:坏的解释器

    # ll /usr/bin/python python python2 python2.6 python2.7 python.bak 1,这里先备份原来的/usr/bin/python 为python ...

  10. centos git clone 报错 fatal: HTTP request failed 解决办法

    git clone报错提示 git clone https://github.com/xxxx.git Initialized empty Git repository in /root/xxxx/. ...

随机推荐

  1. Jquery计算指定日期加上多少天、加多少月、加多少年的日期

    /* * 功能:实现VBScript的DateAdd功能. * 参数:interval,字符串表达式,表示要添加的时间间隔. * 参数:number,数值表达式,表示要添加的时间间隔的个数. * 参数 ...

  2. vue.js在visual studio 2017下的安装

    1.打开"工具"菜单->"NuGet 包管理器"->"管理解决方案 Nuget 的程序包": 在红色标识的地方输入vue: 2. ...

  3. Vue.js常用指令:v-model

    一.v-model指令 v-model 用来获取表单元素的值.对应input输入框获取的是输入的值,单选按钮.复选框.下拉框获取的是选择的状态. 代码示例如下: <!DOCTYPE html&g ...

  4. Retrieve id of record just inserted into a Java DB (Derby) database

    https://stackoverflow.com/questions/4894754/retrieve-id-of-record-just-inserted-into-a-java-db-derby ...

  5. debian系列下c++调用mysql, linux下面安装mysql.h文件

    mysql.h的报错还没有解决,你们不用看了,等我解决了吧还不知道什么时候 先用c吧 #include <stdio.h> #include <stdlib.h> #inclu ...

  6. H3C ER6300 + 两台 H3C S5120 组网举例

    组网需求: 1.H3C ER6300 作出口路由.防火墙及Qos限速等功能(ER6300 配置LAN口 192.168.30.254默认网关) 2.H3C S5120 两台配置相同VLAN10 VLA ...

  7. 在Android Studio中查看Sqlite的方法

    只说最好的方法,使用工具stetho:http://facebook.github.io/stetho/ 1.在Gragle中加上如下语句: dependencies { // Stetho core ...

  8. js操作DOM在父元素中的结尾添加子节点注意

    impressionHtml=`<img src=${value} alt=""/>`; document.getElementById("wrapper&q ...

  9. [Converge] Feature Selection in training of Deep Learning

    特征相关性对于DL的影响 链接:https://www.zhihu.com/question/47908908/answer/110987483 经验一:  1. 输入特征最好不相关.如果某些维输入的 ...

  10. DevExpress MemoEdit定位到末尾

    1: /// <summary> 2: /// 追加文本到MemoEdit中 3: /// </summary> 4: /// <param name="mem ...