首先,没有GUI工具可以完成这一件事情, 不过使用命令行也是一件很简单的事情。
一下假设当前用户名为shen
首先使用sudo visudo
,然后向文件中间添加
shen ALL=(ALL) NOPASSWD:ALL
然后执行命令
sudo passwd -d shen # `whoami`就是当前用户
但是当在终端中间敲下su
的时候,依旧是弹出需要密码提示,原因是没有删除管理员的密码,需要做的事情很简单
sudo passwd -d root
参考原文
You can’t do that using the GUI tool, but you can using the terminal.
- 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.
- Delete the password for your user by running this command:
sudo passwd -d `whoami`