If you are using WSL or Linux-based distribution (i.e Ubuntu) on Windows OS, sometimes you start Ubuntu and it defaults to the
root user. I found one of many solutions that work like magic.
Each time it happens, simply do the following:
Start Powershell as admin. To do this, right-click on the PowerShell application, and you will see the option to
run as administrator. Click on it.
Edit and paste the following command in the terminal. Replace the distro version with the version of Ubuntu you have installed on your machine. For me, I have
Ubuntu20.04.06installed. Ignore the last two digits, and replace the last arguments with the username you have set when you first configure Ubuntu. For me, I used
bobelr. Replace it with your username.
ubuntu2004.exe config --default-user bobelr
- Run this in Powershell, then
- Launch Ubuntu.
Ubuntu should now start with the custom user as default.
As a Celo developer, you’re most likely to work with Linux OS or WSL on Windows such as when analyzing smart contracts using security tools like Securify or Slither. These tools work well and efficiently on Linux OS. If you’re a Windows user, you’re most likely to encounter this type of issue if you’re using WSL.