su -
useradd user_name //user_name is your user name
cd etc
ls -al sudoers
sudo chmod 777 sudoers
ls -al sudoers
vim sudoers //copy root to new line, modify new line root to user_name
sudo chmod 440 sudoers
增加默认用户:
#增加默认用户为root
#admin powershell
wsl --shutdown
ubuntu1604.exe config --default-user root
wsl2 加一个非root用户名
于 2021-09-20 18:50:31 首次发布
本文介绍如何通过修改sudoers文件来赋予指定用户sudo权限的方法。包括添加用户、修改sudoers文件权限、使用vim编辑器进行文件编辑等步骤。
3348

被折叠的 条评论
为什么被折叠?



