Windows 10: How do I disable root login in WSL2? "wsl -d ubuntu -u root" from Terminal will login to...

Discus and support How do I disable root login in WSL2? "wsl -d ubuntu -u root" from Terminal will login to... in AntiVirus, Firewalls and System Security to solve the problem; Is the following behavior correct and expected? With WSL2 Ubuntu 18.4, Windows 10 2004 19041.207, from a non-admin Windows Terminal, I can execute... Discussion in 'AntiVirus, Firewalls and System Security' started by diegoag666, Apr 20, 2020.

  1. How do I disable root login in WSL2? "wsl -d ubuntu -u root" from Terminal will login to...


    Is the following behavior correct and expected?

    With WSL2 Ubuntu 18.4, Windows 10 2004 19041.207, from a non-admin Windows Terminal, I can execute "wsl -d ubuntu -u root" and login to a root shell, without requiring a password even if a root password is set.

    I just installed the distro. It created a sudo user as described in the manual. If I login with "Ubuntu.exe" it will default to the sudo user and require the configured password.

    From the root shell I "passwd". Exit. Try again "wsl -d ubuntu -u root", and it bypasses any password protection again. Even though it should be set.

    I've been googling this without any definite answers.

    :)
     
    diegoag666, Apr 20, 2020
    #1
  2. hellrazor Win User

    How to login to root account in LMDE ?

    I don't know about debian edition, but in Gnome Edition I can just login as root with my administrator account password at the login screen - but keep in mind that Gnome Edition is based on Ubuntu and Debian Edition is based on Debian and the only common thing between Ubuntu and Debian is the barest necessities in the Linux kernel.
     
    hellrazor, Apr 20, 2020
    #2
  3. How to login to root account in LMDE ?

    Are you trying to access through terminal?
    Root mode in debian should be su- or su -
    sudo gedit will get you into any config file as root
    /etc/sudoers contains information on giving accounts root privelage
    sudo visudo is used to open this sudoers file to edit permissions.
    I agree with the others, the GUI is great but linux is ALOT of cmd line, so if you want to learn this it is crucial that you learn command line, you will get no where fast without it.
     
    eightclicknine, Apr 20, 2020
    #3
  4. How do I disable root login in WSL2? "wsl -d ubuntu -u root" from Terminal will login to...

    Ubuntu / no root ? / copying issue

    By default the root password in ubuntu is not set. To set it, go to the terminal and type in

    Code: sudo passwd[/quote] It will then ask you to enter your current users " root " password which is just your normal password. Then it will ask you to enter your new UNIX root password which is the system root password. Do that twice, now you've set the root password. You should now have 100% full access to your file system. To become root under the terminal, type in

    Code: su[/quote] Then enter the password.

    The easiest ways to copy files IMO is to install midnight commander. Look for in in the Synaptic Package Manager.
     
    johnnyfiive, Apr 20, 2020
    #4
Thema:

How do I disable root login in WSL2? "wsl -d ubuntu -u root" from Terminal will login to...

Loading...
  1. How do I disable root login in WSL2? "wsl -d ubuntu -u root" from Terminal will login to... - Similar Threads - disable root login

  2. How to install terminal icons in wsl2 ubuntu

    in Windows 10 Gaming
    How to install terminal icons in wsl2 ubuntu: I want to see the files and folder icons when I use the ls command. Is there any way to achieve this? https://answers.microsoft.com/en-us/windows/forum/all/how-to-install-terminal-icons-in-wsl2-ubuntu/7c810f10-3237-462b-8845-dcdb98f644e7
  3. How to install terminal icons in wsl2 ubuntu

    in Windows 10 Software and Apps
    How to install terminal icons in wsl2 ubuntu: I want to see the files and folder icons when I use the ls command. Is there any way to achieve this? https://answers.microsoft.com/en-us/windows/forum/all/how-to-install-terminal-icons-in-wsl2-ubuntu/7c810f10-3237-462b-8845-dcdb98f644e7
  4. How do I open WSL Ubuntu?

    in Windows 10 Gaming
    How do I open WSL Ubuntu?: I installed WSL Ubuntu on my Windows 11 desktop PC but it will not open.When I click the Ubuntu icon in the Start menu, this PowerShell command line appears with --- "my username and my computer name :~$". --- I do not know what to enter after $ to open Ubuntu. I have...
  5. How do I open WSL Ubuntu?

    in Windows 10 Software and Apps
    How do I open WSL Ubuntu?: I installed WSL Ubuntu on my Windows 11 desktop PC but it will not open.When I click the Ubuntu icon in the Start menu, this PowerShell command line appears with --- "my username and my computer name :~$". --- I do not know what to enter after $ to open Ubuntu. I have...
  6. How do I run a root/admin script at WSL2 shell startup?

    in Windows 10 Gaming
    How do I run a root/admin script at WSL2 shell startup?: So, on Linux I would put a script in /etc/profile.d, make it owned by root root:root and make it executable. I did all that in my WSL2 Windows 11 shell and I get this:hwclock: Cannot access the Hardware Clock via any known method. hwclock: Use the --verbose option to see the...
  7. How do I run a root/admin script at WSL2 shell startup?

    in Windows 10 Software and Apps
    How do I run a root/admin script at WSL2 shell startup?: So, on Linux I would put a script in /etc/profile.d, make it owned by root root:root and make it executable. I did all that in my WSL2 Windows 11 shell and I get this:hwclock: Cannot access the Hardware Clock via any known method. hwclock: Use the --verbose option to see the...
  8. Downloads are going to root of D drive

    in Windows 10 Network and Sharing
    Downloads are going to root of D drive: We were trying to move the location of my downloads folder from its original place in C drive, but accidentally failed to create a download folder for the D drive before changing the location, causing it to be connected to the root of the D drive.We've restored the original...
  9. Downloads are going to root of D drive

    in Windows 10 Gaming
    Downloads are going to root of D drive: We were trying to move the location of my downloads folder from its original place in C drive, but accidentally failed to create a download folder for the D drive before changing the location, causing it to be connected to the root of the D drive.We've restored the original...
  10. Downloads are going to root of D drive

    in Windows 10 Software and Apps
    Downloads are going to root of D drive: We were trying to move the location of my downloads folder from its original place in C drive, but accidentally failed to create a download folder for the D drive before changing the location, causing it to be connected to the root of the D drive.We've restored the original...

Users found this page by searching for:

  1. disable auto-login WSL