diff --git a/wsl-oobe.sh b/wsl-oobe.sh index e406b57..ace2e51 100644 --- a/wsl-oobe.sh +++ b/wsl-oobe.sh @@ -25,7 +25,11 @@ read -r -p 'Enter new UNIX username: ' username /usr/sbin/useradd -m -G wheel --uid $DEFAULT_USER_ID "$username" cat > /etc/sudoers.d/wsluser << EOF -# Ensure the WSL initial user can use sudo +# Ensure the WSL initial user can use sudo without a password. +# +# Since the user is in the wheel group, this file can be removed +# if you wish to require a password for sudo. Be sure to set a +# user password before doing so with 'sudo passwd $username'! $username ALL=(ALL) NOPASSWD: ALL EOF @@ -36,3 +40,6 @@ cat >> /etc/wsl.conf << EOF [user] default = "$username" EOF + +echo 'Your user has been created, is included in the wheel group, and can use sudo without a password.' +echo "To set a password for your user, run 'sudo passwd $username'"