mirror of
https://github.com/Baipyrus/dotfiles.git
synced 2024-12-26 03:11:45 +00:00
bugfix: fix command to add user to sudoers group
This commit is contained in:
parent
7aa94ca8e2
commit
7e8bc5fa19
@ -35,8 +35,8 @@ function WSLInstall
|
|||||||
wsl.exe --install -d Ubuntu
|
wsl.exe --install -d Ubuntu
|
||||||
|
|
||||||
# Add newly created user to sudoers group
|
# Add newly created user to sudoers group
|
||||||
$user = wsl.exe cut "-d:" "-f1" /etc/passwd
|
$user = wsl.exe cut "-d:" "-f1" /etc/passwd | Select-Object -Last 1
|
||||||
wsl.exe -u root echo "echo ""$user ALL=(ALL) NOPASSWD:ALL"" >> /etc/sudoers.d/$user"
|
wsl.exe -u root echo "$user ALL=(ALL) NOPASSWD:ALL" ">>" "/etc/sudoers.d/$user"
|
||||||
|
|
||||||
# Update packages and install from list
|
# Update packages and install from list
|
||||||
wsl.exe sudo apt update "&&" sudo apt upgrade "-y"
|
wsl.exe sudo apt update "&&" sudo apt upgrade "-y"
|
||||||
|
Loading…
Reference in New Issue
Block a user