Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prompt user for username and password on start WSL Ubuntu

I am aware of functions to set a default user or change password for WSL Ubuntu like in askubuntu thread here or official docs.

What I'm looking for is when we do wsl from a cmd, or click the Ubuntu 18.04 LTS from Start Menu, I would like to have the same effect as when SSH into a server, it will ask for name or password. I do not want to automatically sign-in. I figured maybe all I need is to not set any default user, but couldn't find how to do that anywhere.

It seems to do this from a normal Ubuntu distro, I would have to edit it in the Settings > Detail or do it from terminal like here - but that's using gdm, I don't think WSL has that.

like image 524
Reis Avatar asked Sep 17 '25 18:09

Reis


1 Answers

I use a workaround to impose password check for privileged users in WSL. Had created a normal logins with sudo for me and my son in ubuntu2004. Additionaly created kind of guest login without any privileges and made this login the default. So, after starting with bash, we both need to do su - your_login with usual password check.

like image 62
Oleg P. Philon Avatar answered Sep 19 '25 08:09

Oleg P. Philon