Ok so last night i was trying to set permissions to some folders in my File System, since apparently im not an admin on my own computer. And now everything got messed up today and i don't know what to do..

  • I lost my internet, the icon is not showing in the taskbar anymore.
  • I lost my sound, there is no sound devices listed when i go into the sound menu.
  • I can not log into root anymore, it gives me "sudo: must be setuid root"
  • I can not plug anything in anymore, it will not recognize flash drives or external hard drives.
  • It gives me a Internal Error message everytime i log in
  • It doesn't let me log into the Grub screen anymore on boot up.

What did i do? I have a lot of files on here i wish to put on a flash drive but it won't recognize it.


Sounds as if you changed the ownership and / or permissions of system files.

You can search ~/.bash_history for the commands you ran, and if you post them here perhaps they are easily reversed.

gedit ~/.bash_history

Look for commands such as chown or chmod , if they were run with the -R (recursive) option, easier to re-install. If, however, you changed only a few files or directories, recovery is possible.

Often though you will have to re-install as manually fixing permissions is time consuming and imperfect.

In the future see: ubuntu sudo page

Normally you use sudo or for graphical applications gksu to perform system administration or edit system files.


gksu gedit /path/to/file
sudo command
  • Oh, good one about checking bash_history. I didn't think of that. – geirha Jul 1 '12 at 16:21
  • Never mind i got it. But i really don't want to type in all of that.. Im on my laptop right now since i don't have internet on the messed up computer. – Josh B Jul 1 '12 at 16:28
  • Honestly, based on your comments, and the likelihood you used -R, based on the number of errors you have, I suggest you back up your data and re-install. It is just going to be faster that way and as you seem new to Ubuntu it is unlikely you have made significant changes to your system yet. Just my 2c – Panther Jul 1 '12 at 16:32
  • I do want to do a re-install, but how can i back up anything if it can't recognize my external hard drive? And yes i do believe i used -R.. – Josh B Jul 1 '12 at 16:35
  • Boot a live CD or live Flash drive, copy your data, re-install, restore your data. You can copy data with gksu nautilus. – Panther Jul 2 '12 at 1:17

Sounds like you hosed your system by changing permissions and/or ownership of important system files. Depending on what exactly you did, fixing the system could be easy or hard.

Given that you're not sure what exactly you did that caused this, I'd say a reinstall is probably the easiest option. It is quite likely possible to undo what you did and get your system back to normal, but a reinstallation may take less time to get a working system back.

Nothing you've mentioned so far suggests that your personal files have been removed/compromised, so you should be able to extract your files from your harddrive by booting an Ubuntu Desktop CD/USB, mounting your partition(s) and copying the important files to another media, like a USB stick/harddrive or network share.

  • Yeah i was thinking about doing just a fresh install, but i didn't want to lose all my files. Can you link me to a tutorial on how to do the mounting part? Thank you for your help though, i don't know what the hell i did haha.. – Josh B Jul 1 '12 at 16:26

We don't necessarily know everything that's wrong with your system, but we do know one thing that's wrong:

sudo: must be setuid root

sudo is the primary mechanism used to perform administrative tasks in an Ubuntu system. Its ownership and/or permissions are broken, so it cannot work.

Fortunately, on a desktop Ubuntu system, there is another mechanism used to perform administrative tasks: PolicyKit. So you can usually fix a broken sudo using the pkexec command-line frontend to PolicyKit, without even having to boot into recovery mode or from a live CD/DVD/USB. sudo having the wrong ownership/permissions is not the most common breakage scenario, but it's fixed just as easily. Just open a Terminal window (Ctrl+Alt+T) and run these commands:

pkexec chown root:root /usr/bin/sudo
pkexec chmod 4755 /usr/bin/sudo

Running those commands should fix the permissions on sudo.

That might or might not fix the basic problem. You can see if sudo works now by running a harmless command like sudo ls. You should update your question and/or comment here to provide information about what errors you see next, if any.

Once you regain full access to your system you should do one of two things:

  • Look at your .bash_history to figure out what commands you ran, then update your question so that we can tell you how to undo any other damage that was done. Your system may still be in an insecure or unstable state, even if things seem to be working all right.

  • Or, do a fresh reinstallation of Ubuntu, if you're not able to do that.

Finally, please note:

  • In a situation where you are actually not an administrator on your own computer, that can be fixed quite easily. Fixing it does not involve changing the permissions on any files. Changing the permissions on files does not fix this.

  • If you an break your system the way it seems you have--that is, if you can change the ownership or permissions of /usr/bin/sudo--then you were definitely already an administrator on your system (unless you booted to recovery mode or from a live CD/DVD/USB to do it). Non-administrators cannot make such changes to an Ubuntu system.

  • Even when you are an administrator on your system, you may see "access denied" and similar messages when attempting to perform some tasks. This does not generally mean that you are unable to perform them, but rather that you are not using the right technique to perform them. In particular, administrator accounts are still limited--you must use something like sudo to perform most administrative actions.


Looks like you lost you rights on the sudo file.

Reboot your computer, select Recovery console and do :

chown root:root /usr/bin/sudo

chmod 4755 /usr/bin/sudo

this should fix your sudo problem.

A complete tuto about it : http://www.psychocats.net/ubuntu/fixsudo#recoverymode

  • That will fix the problem with sudo, but, the user will likely have to fix more then just that. – Panther Jul 1 '12 at 16:15
  • Yep, sure. But it's way better to solve problems with a sudo access :) – x_vi_r Jul 1 '12 at 16:18
  • That doesn't help me though xXx because i can not boot into the recover console.. – Josh B Jul 1 '12 at 16:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.