Skip to content

Instantly share code, notes, and snippets.

@dewdad
Forked from richardszalay/Reset-BashPassword.ps1
Created April 29, 2018 11:32
Show Gist options
  • Save dewdad/a3b891ffa60dc8bd979fdce0d6c29dfb to your computer and use it in GitHub Desktop.
Save dewdad/a3b891ffa60dc8bd979fdce0d6c29dfb to your computer and use it in GitHub Desktop.
Reset-BashPassword.ps1
# Resets the password for the default LXSS / WSL bash user, based on https://askubuntu.com/a/808425/697555
$lxssUsername = (Get-ItemProperty HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss).DefaultUsername
lxrun /setdefaultuser root
bash -c "passwd $lxssUsername"
lxrun /setdefaultuser $lxssUsername
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment