Add “Sudo” user If somehow you Lost a “sudo” user which happened to me today, after upgrading Ubuntu, you can recover the sudo used by following below commands, switch to root user, $ su root Password: # adduser username sudo # reboot Now, after successful reboot, you should have a “sudo” user as your “username”
Execution & Command Syntax
sudo used by following below commands, switch to root user, $ su root Password: # adduser username sudo # reboot Now, after successful reboot, you should have a “sudo” user as your “username”Risk level: caution. Review the command before running it.
Gotchas and Common Issues
Permission Verification - confirm execution permissions and path variables before invoking system binaries.
Version Compatibility - check software version release notes for deprecated flags or syntax changes.
Log Monitoring - inspect system logs (
journalctlor/var/log) to troubleshoot execution failures.
Following these steps ensures clean configuration, proper security boundaries, and reliable execution for fix : lost sudo user in linux.
Comments and corrections