What to Do If You Forget the WSL Root Password
Solution First, opening WSL does not require entering a password. If the default user when you open WSL is not root, please modify it as follows. Change the default WSL login user Start PowerShell with administrator privileges lxrun /setdefaultuser root At this point, reopening WSL will log you in as the root user, and no password is required. Then enter the following command to change the password. passwd root About For more interesting operations, follow my WeChat official account: DealiA
目录4 个章节
Solution
First, opening WSL does not require entering a password. If the default user when you open WSL is not root, please modify it as follows.
Change the default WSL login user
Start PowerShell with administrator privileges
lxrun /setdefaultuser root
At this point, reopening WSL will log you in as the root user, and no password is required.
Then enter the following command to change the password.
passwd root
About
For more interesting operations, follow my WeChat official account: DealiAxy Every article is also collected on my blog: blog.deali.cn
_EOF_
What to Do If You Forget the WSL Root Password
- 本文作者:
- 程序设计实验室
- 版权声明:
- 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
相关文章
使用命令行删除 Windows 网络映射驱动器
Windows 这破系统至今还卡死右键菜单?命令行删映射盘算个事。真就没人修复这 XP 时代的老问题?
2025-10-02 · Windows · 约 1 分钟
用 dnot.sh 替代 Windows Defender
dnot.sh 往安全中心塞了个假 AV 签名,Defender 就乖乖下岗了——至少监控上看。实际还得再跑 extra-strip.bat 才能真关,这两步缺一不可,属实有点折腾。搞定即裸奔,胆子小的别碰。
2026-09-17 · Windows · 约 1 分钟
IT之家学院:让你的Win10桌面比macOS还简洁漂亮高大上
感谢IT之家网友 yiyueduzui 的原创投稿 直奔主题,先给大家看看我的电脑桌面: 有人开始骂了:你特么逗我呢?这明明就是一张图片好不啦! 我读书那么多,怎么会骗你,这真的是我的电脑桌面,不还有个桌面数字时钟呢嘛!论简洁,还有谁? 那这啥都没有,要怎么用啊? 看好啦,当我的鼠标移动到屏幕下方的时候, 出现了一个Dock栏,跟苹果系统的一样一样的。 有些图标其实是一个目录或者文件夹,当它展开的
2021-12-18 · Windows · 约 1 分钟
Kali-Linux-on-WSL2安装与简单配置指南
Windows在更新到2004版本之后正式开启了WSL2的支持,这次是完整的运行在HyperV虚拟机中的Linux系统了,可以称之为真正的Linux了,难不成Windows即将成为最好的Linux发行版? 实际体验下来还是可以的,不过小问题不少,爱折腾的同学安排一手,对提高Windows平台下的开发体验还是有很大帮助的~ Kali on WSL2安装指南 升级系统 首先检查当前系统版本,按Win+
2021-12-18 · Windows · 约 1 分钟
讨论
共 0 条加载评论中…
