返回文章列表文章索引阅读全文
STARBLOG / 阅读手记
Windows

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

曦远 (DealiAxy)约 2 分钟
目录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