4

I just typed "sudo chmod 770 ." on my /usr/bin directory by mistake

[acc]:/usr/bin$ sudo chmod 770 .

Now every time i run a sudo command I get a "Permission denied" error

[acc]~$ sudo
bash: /usr/bin/sudo: Permission denied

When I open a new terminal, i get: "bash: groups: command not found"

Please help me resolve this... :(

1
  • Update: I tried to restart my machine but it didnt boot. I had to come back in windows.... :'''(
    – Timothy
    Oct 6, 2013 at 9:33

3 Answers 3

3

You should boot from a LiveCD then do the following:

  1. Mount your Ubuntu installation by clicking on the device's icon in the file manager.
  2. Open a terminal and cd into the /usr/bin folder of that installation you mounted from above.
  3. Run this command to give all users execute permissions

    sudo chmod -R a+x .
    
  4. Run this command to give all users read permissions

    sudo chmod -R a+r .
    
  5. Run this command to remove all users (except root's) write permissions

    sudo chmod -R o-w .
    
  6. Reboot and see if it works.
3
  • Thanks, before I try this. hope you saw the dot at the end of my line " sudo chmod 770 .".And can I do this using recovery mode?
    – Timothy
    Oct 6, 2013 at 9:54
  • @TechyTimo you can try recovery mode, drop to a root shell, run mount -o remount,rw / and type those commands (without sudo in front). I also added . to the end of my commands
    – kiri
    Oct 6, 2013 at 9:57
  • Amazing! You are a genious! It worked and I did not need a LiveCD. Thanks a lot
    – Timothy
    Oct 6, 2013 at 10:53
0
  • boot into recovery mode
  • Select root
  • Press enter to continue
  • Type chmod 755 /usr/bin
-1

One possibility is:

  1. Boot into recovery mode with ubuntu. (select advanced options on the grub menu, then Ubuntu with recovery mode)

  2. Then, select "Root" in the list of options. That will give you root-permissions in the recovery mode, and you will enter the terminal

  3. do: cd /usr/bin and then try to do sudo chmod 777

(i am not sure if it should be 7777 because that grants access for everyone)

4 . Reboot

Good luck.

4
  • Damn! That didnt work. Getting same error flashing on a black screen when i boot : "could not write pipes , check battery state...
    – Timothy
    Oct 6, 2013 at 9:51
  • Okay i suppose you need to boot in a live CD then. Look at the other answer; and follow his steps. Good luck.
    – denNorske
    Oct 6, 2013 at 9:53
  • I do not have a cd close here.. can this also work with a usb boot?
    – Timothy
    Oct 6, 2013 at 9:57
  • @TechyTimo yes, you just need Ubuntu bootable media. It's generally called a LiveCD
    – kiri
    Oct 6, 2013 at 9:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .