在WSL2 root 和普通用户的切换
WSL
Issues found on WSL
项目地址:https://gitcode.com/gh_mirrors/ws/WSL

·
1:首先如果你使用的是window11的window stores 的 ubuntu ,首先打开一个command window,
输入 :
ubuntu2204 config --default-user root
这样就切换到 root 登录下了
2:打开wsl2的ubuntu2204,现在你就是root的根用户了,这里你可以重置你的用户密码
如下: passwd xxxx (用户名) ;后面你可以重置你的用户密码
3:再次切换到普通用户
ubuntu2204 config --default-user 普通用户名
接着你再打开wsl2的ubuntu,就是普通用户的权限了。你可以使用sudo 来进行根权限的操作了
注:ubuntu2204为系统名加版本号




Issues found on WSL
最近提交(Master分支:5 个月前 )
8c61f09e
* Add super user detection; a powershell approach is used
* use the 'id' command
* avoid stderr warning & wsl alias 17 天前
ae780d11
17 天前
更多推荐
所有评论(0)