Able to access with root user without sudo. #3033

Closed
opened 2026-01-30 23:11:22 +00:00 by claunia · 2 comments
Owner

Originally created by @fthomasella on GitHub (Jul 31, 2019).

Environment

Microsoft Windows [Version 10.0.18362.239]
Windows Terminal (Preview)
Version: 0.2.1831.0

Ubuntu 18.04 LTS
Linux 4.4.0-18362-Microsoft #1-Microsoft Mon Mar 18 12:02:00 PST 2019 x86_64 x86_64 x86_64 GNU/Linux

Steps to reproduce

1- Install "Windows Subsystem for Linux"
2- Install any Linux distro, in this case I use Ubuntu 18.04 LTS
3-Open "Windows Terminal (Preview), with Windows Terminal go to the terminal droplist and choose "Ubuntu-18.04" it will open Ubuntu with root user as default.

The issue occuer because I don't finished the initial setup after install ubuntu (create a user, ,setup user passwd, setup a root password e.g..)

After doing the initial setup the problem as solved and "Windows Terminal (Preview)" open with my user and ask for password when I try to became root.

As sugestion, ask the initial setup in "Windows Terminal (Preview)", the same way you already do in cmd/bash.

Originally created by @fthomasella on GitHub (Jul 31, 2019). # Environment Microsoft Windows [Version 10.0.18362.239] Windows Terminal (Preview) Version: 0.2.1831.0 Ubuntu 18.04 LTS Linux 4.4.0-18362-Microsoft #1-Microsoft Mon Mar 18 12:02:00 PST 2019 x86_64 x86_64 x86_64 GNU/Linux # Steps to reproduce 1- Install "Windows Subsystem for Linux" 2- Install any Linux distro, in this case I use Ubuntu 18.04 LTS 3-Open "Windows Terminal (Preview), with Windows Terminal go to the terminal droplist and choose "Ubuntu-18.04" it will open Ubuntu with root user as default. The issue occuer because I don't finished the initial setup after install ubuntu (create a user, ,setup user passwd, setup a root password e.g..) After doing the initial setup the problem as solved and "Windows Terminal (Preview)" open with my user and ask for password when I try to became root. As sugestion, ask the initial setup in "Windows Terminal (Preview)", the same way you already do in cmd/bash.
claunia added the Issue-QuestionProduct-WSLNeeds-Tag-FixResolution-Answered labels 2026-01-30 23:11:22 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Jul 31, 2019):

Huh. Not sure how we'd be able to fix that.

When we're setting up the default linux profiles, we're setting them up with the commandline wsl.exe -d <distroname>. That means we're skipping the app's install process entirely, and just asking wsl to launch that distro. The app's executable (ubuntu.exe) is the actual exe respo;nsible for the install process, wsl.exe doesn't know anything about it. In fact, the app might not even have an initial setup step. I'm also fairly certain there's no stable distro <-> executable mapping that we can rely on, which is why we're using wsl to launch the distro instead of ubuntu

Summoning @benhillis who might have some ideas here, but I'm not certain there's much we can do about this.

@zadjii-msft commented on GitHub (Jul 31, 2019): Huh. Not sure how we'd be able to fix that. When we're setting up the default linux profiles, we're setting them up with the commandline `wsl.exe -d <distroname>`. That means we're skipping the app's install process entirely, and just asking `wsl` to launch that distro. The app's executable (`ubuntu.exe`) is the actual exe respo;nsible for the install process, `wsl.exe` doesn't know anything about it. In fact, the app might not even have an initial setup step. I'm also _fairly_ certain there's no stable distro &lt;-> executable mapping that we can rely on, which is why we're using `wsl` to launch the distro instead of `ubuntu` Summoning @benhillis who might have some ideas here, but I'm not certain there's much we can do about this.
Author
Owner

@DHowett-MSFT commented on GitHub (Aug 1, 2019):

The problem is, though, that the distribution is not registered until you've run ubuntu.exe or whatever.exe. Once you have run it, it is fair game. This torn state can happen even if you use wsl.exe -d <distro> directly.

In fact, if you run ubuntu.exe, stop in the middle of setup, and then run ubuntu.exe AGAIN you will log in as root.

The customization steps are fully dictated by the distribution's installer author. If you abort in the middle of them, you are inviting all sorts of unusual behavior. This isn't something the terminal can fix, and this also isn't something WSL can fix.

@DHowett-MSFT commented on GitHub (Aug 1, 2019): The problem is, though, that the distribution is **not registered** until you've run `ubuntu.exe` or `whatever.exe`. Once you have run it, it is fair game. This torn state can happen even if you use `wsl.exe -d <distro>` directly. In fact, if you run `ubuntu.exe`, stop in the middle of setup, and then run `ubuntu.exe` AGAIN you will log in as `root`. The customization steps are fully dictated by the distribution's installer author. If you abort in the middle of them, you are inviting all sorts of unusual behavior. This isn't something the terminal can fix, and this _also_ isn't something WSL can fix.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#3033