Help! I Renamed Sudo and Now I Can't Use It

August 17, 2025 4 answers
Asked by handwriting sample
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?

Answers

night shift notes
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.
Reply to this answer
_64 ceiling panels
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.
Reply to this answer
_clinic waiting room
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.
Reply to this answer
~slightly tangy~
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.
Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions