Sudo su password12/2/2023 ![]() Even when working form windows, its still a bad practice. You probably also do not want to leave your default user as root. You probably do not want to change the root users password (because in Ubuntu, the root user generally should not have a password, sudo should be used instead). You probably want to change the password of the sudo-capable, non-root user. Some key differences between su vs sudo include: su command in linux allows a user to switch to another user account and gain all of its privileges, while sudo command in linux allows a user to execute a specific command with the privileges of another user. in legacy versions 1703, 1709: lxrun /setdefaultuser.The prompt will change from to, indicating you have root access. Your working directory will be /root, and it will read roots. in current versions: ubuntu.exe config -default-user su is equivalent to sudo -i and simulates a login into the root account.Then open the Linux Bash shell which will log you in as root without asking for password. Then type ubuntu config -default-user root to set root as the default user for Linux Bash Shell. ![]() in windows cmd.exe, you can change the default WSL user (permanently): If you forgot your password on WSL simply open your command prompt from windows by typing cmd on search.in wsl, sudo generally asks for the password of the current WSL user.in wsl, passwd will change the password of any WSL user.to specify which WSL user to use (temporarily) wsl -u Use the following command to edit the /etc/sudoers file: sudo visudo This will open the default text editor (Nano in Ubuntu) for editing this file.in wsl, passwd will change the password of the current WSL user.in wsl, sudo passwd will change the password of the WSL root user. For example, the below will safely pipe your password to the sudo command, without retaining a history of your password. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |