I accidentally renamed the sudo command in my system while trying to make some changes. I went to /usr/bin and renamed sudo to squidd, and then attempted to do the same in /usr/libexec. Now I can't use sudo at all. I considered switching to the root user, but I never set a password for it. What should I do to fix this?
4 Answers
If you didn't set a root password, logging in directly as root might not work. A straightforward solution is to boot from a live CD or USB. This way, you can access your filesystem and rename 'squidd' back to 'sudo' from another OS.
Alternatively, you can boot into single user mode or a similar recovery environment, depending on your distribution. You should be able to undo your changes there without too much hassle.
You might want to try switching to the root user and renaming that file back to 'sudo'. Typically, if you haven't set a root password, it defaults to the same as your install user.
Reinstalling your OS might be the quickest solution if you can't figure it out. It’s always a pain, but sometimes that's the easiest route.
Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures