mishamosher / CentOS-WSL

A GitHub Actions automated CentOS RootFS to use with WSL
MIT License
1.32k stars 207 forks source link

Launches into root account - would like to launch into un-elevated user profile #16

Closed tbraun84 closed 1 year ago

tbraun84 commented 2 years ago

To prevent me from doing something foolish, I would like to launch CentOS with a non-root account. Is this setting "visible" in the builds?

Vinfall commented 2 years ago

It's built using wsldl (see https://github.com/mishamosher/CentOS-WSL/blob/9-stream/build.sh#L16) . You can run .\CentOS.exe config --default-user averagejoe to set the default user as averagejoe.

Or more universally, you can run the distro with --user handsomejake param setting in Windows Terminal or set User in /etc/wsl.conf inside WSL:

# Set the user when launching a distribution with WSL.
[user]
default = DemoUser