Linux下刪除密碼
沒有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.
-
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`