1

I was trying to make an adjustment to the /etc/sudoers file, and I accidentally corrupted it. I restored it via the grub and using the Ubuntu 14.04 default.

But now it seems I can change ownership or permissions when trying to run sudo chown and sudo chmod. I cant even sudo sh.

I just get the following error:

sudo: chown: command not found

Is there anything that I might have lost in the sudoers file that was allowing me to run these commands?

This is my output of $PATH

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

This is the output from: whereis sudo chown

sudo: /usr/bin/sudo /usr/lib/sudo /usr/bin/X11/sudo /usr/share/man/man8/sudo.8.gz chown: /bin/chown /usr/share/man/man2/chown.2.gz /usr/share/man/man1/chown.1.gz

Also.. This is where I got the Generic Ubuntu 14.04 sudoers file from. http://heggel4.wordpress.com/2012/10/25/repair-sudoers-file-on-ubuntu-12-04-lts/

Please help. I'm in over my head :/ Thanks all :)

Mark
  • 111
  • 2
    Post output of echo "$PATH" – ElefantPhace Aug 14 '14 at 17:18
  • @user68186 I already saw this other thread and was able to use it to fix my sudoers file, but I still cannot run any of the following commands: chown, chmod, sh. Maybe I'm missing something? – Mark Aug 14 '14 at 18:29
  • @ElefantPhace I added the output of the $PATH not really sure what to do with it? – Mark Aug 14 '14 at 18:30
  • 1
    Hmm... Post output of whereis sudo chown – ElefantPhace Aug 14 '14 at 19:17
  • @ElefantPhace I added that output as well. I hope it helps.. I'm really quite stuck here :( – Mark Aug 14 '14 at 20:00
  • 1
    Can you use chown without using sudo? Test on a file you own or just type chown – ElefantPhace Aug 14 '14 at 20:10
  • @ElefantPhace Ahh I didnt think about that ... looks like I can't do it... comes with the error: chown: missing operand ... Did I uninstall it somehow ?? – Mark Aug 14 '14 at 20:14
  • No that means that it can find it. Something is still wrong with sudo though – ElefantPhace Aug 14 '14 at 20:15
  • @ElefantPhace Ah yea... just tried it with a file and it worked.. I'm lost, any ideas? – Mark Aug 14 '14 at 20:16
  • 1
    Make sure your secure_path in sudoers matches what is on the page you linked to. – ElefantPhace Aug 14 '14 at 20:23
  • @ElefantPhace Yup its an exact match. I copy pasted it. /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin – Mark Aug 14 '14 at 20:25
  • Just noticed that I can't even run sudo ls which means sudo is stuffed. Does this have something to do with permissions of root maybe? groups? – Mark Aug 14 '14 at 20:27
  • Ah I'm thinking this may have something to do with ZSH.. damn that stupid sudoers file :D Wish I had a photographic memory! – Mark Aug 14 '14 at 20:30
  • The error you got means that chown is not found, if sudoers file is exaclty as link you post, it's really strange tha it doesn't work. Did you edit sudoers file from Windows? – Lety Aug 15 '14 at 09:48

0 Answers0