美文网首页我用 Linux
Linux下删除密码

Linux下删除密码

作者: Martins3 | 来源:发表于2019-04-25 15:44 被阅读0次

没有GUI工具可以完成这一件事情。

首先使用sudo visudo ,然后向文件中间添加

 your_user_name ALL=(ALL) NOPASSWD:ALL

然后执行命令

 sudo passwd -d `whoami`

参考原文

You can't do that using the GUI tool, but you can using the terminal.

  1. First, if your user has sudo privileges, you must enable its NOPASSWD option. Otherwise, sudo will ask for a password even when you don't have one, and won't accept an empty password.To do so, open the sudoers configuration file with sudo visudo, and add the following line to the file, replacing david with your username:
    david ALL=(ALL) NOPASSWD:ALL

Close the editor to apply the changes, and test the effect on sudo in a new terminal.

  1. Delete the password for your user by running this command:
    sudo passwd -d `whoami`

相关文章

网友评论

    本文标题:Linux下删除密码

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