Add user to sudoers file
sudo is a command line programme that allows trusted users to execute commands as root user.
Running a sudo command will prompt for a password. For local development in WSL, developers may prefer to add their WSL user to the sudoers file to avoid the need for a password.
Update sudoers file
- Open sudoers file with root permission to edit with
sudo nano /etc/sudoers - Append
username ALL=(ALL) NOPASSWD:ALLto bottom of file replacingusernamewith your WSL username - Save and exit the file