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上将git与ssh-agent搭配使用
Windows git 还自带 ssh?真是老土的兼容性思路。一行配置就能解决,不过得先管好 ssh-agent 的连接。 ProxyCommand 居然又添乱,难怪老出毛病。
2025-08-21 · Windows · 约 1 分钟
修复winget命令找不到的问题
微软官方包管理器winget在Windows 10 1809以上版本中,用于快速安装、更新和管理应用程序。本文介绍了因系统环境变化导致winget命令失效的问题,分析了可能原因,并提供了解决方案及预防措施,包括修复命令、定期更新检查、备份环境变量等。
2025-04-04 · Windows · 约 1 分钟
Windows也能拥有好用的命令行吗?Powershell+Terminal折腾记录(v1.0版本)
Windows一向以图形化操作入门容易著称,所以对于命令行的支持一直为人所诟病,比起Linux或者mac都是被吊打的。这一局面在最近几个版本的Windows10更新里,特别是微软官方出了WindowsTerminal这个大杀器之后有所改善~ 所以对于标题的这个问题,只能说「勉强可以吧」,本文介绍几个折腾命令行的方法。 效果图 ~~偷一张官方的截图,应该没人发现吧~~ 建议先熟读官方文档:https
2024-02-29 · Windows · 约 1 分钟
从SSH远程到Git Push:在Windows上一步到位实现免密码登录
我一直希望在Windows上能像在Linux系统中那样,通过SSH密钥实现免密码远程连接。每次远程连接到服务器时,手动输入密码既麻烦又不太安全,尤其是在我需要频繁操作的情况下。
2025-02-10 · Windows · 约 1 分钟
讨论
共 0 条加载评论中…
