美文网首页
Linux下sudo -s无法执行的解决方法

Linux下sudo -s无法执行的解决方法

作者: 龃龉前行 | 来源:发表于2019-10-18 14:22 被阅读0次

    当在Linux下执行 sudo -s 时出现如下提示:

    We trust you have received the usual lecture from the local System
    Administrator. It usually boils down to these three things:
    
        #1) Respect the privacy of others.
        #2) Think before you type.
        #3) With great power comes great responsibility.
    

    解决方法:
    (a)进入超级用户模式。
    输入"su -",系统会让你输入超级用户密码,输入密码后就进入了超级用户模式。(当然,你也可以直接用root)
    (b)添加文件的写权限。
    输入命令"chmod u+w /etc/sudoers"。
    (c)编辑/etc/sudoers文件。
    输入命令"vim /etc/sudoers",进入编辑模式,找到这一 行:"root ALL=(ALL) ALL"在起下面添加"xxx ALL=(ALL) ALL"(这里的xxx是你的用户名),然后保存退出。
    (d)撤销文件的写权限。
    输入命令"chmod u-w /etc/sudoers"。

    相关文章

      网友评论

          本文标题:Linux下sudo -s无法执行的解决方法

          本文链接:https://www.haomeiwen.com/subject/blvimctx.html