Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] loss of sudo and su, user not in sudoers
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
jeffk
Guru
Guru


Joined: 13 Sep 2003
Posts: 587

PostPosted: Mon Aug 25, 2014 4:33 pm    Post subject: [SOLVED] loss of sudo and su, user not in sudoers Reply with quote

My ~amd64 laptop primary user can't sudo after bootup this morning, has left me dead in the water for functions like starting emacs daemon, let alone investigation and repair of the issue. I'd like to provide a package emerge history, but can't ;)
Code:
% sudo ls
Password:
myruser is not in the sudoers file.  This incident will be reported.

I haven't changed anything with visudo or otherwise, and the file seems to be unaltered by file date:
Code:
% ls -lt /etc/sudoers
-r--r----- 1 root root 2847 Aug 19  2010 /etc/sudoers

Nor can I su to root to investigate, e.g. if some package update may be at fault
Code:
% su
Password:
su: Permission denied

Code:
% ls -al /bin/su /usr/bin/sudo
-rws--x--x 1 root root  36752 Jun 16 10:29 /bin/su
-rws--x--x 1 root root 146520 May  9 06:43 /usr/bin/sudo

Any ideas? Dropping out to sysrescueCD is my next option, but it won't be quick or easy to confirm fixes there will work when the laptop reboots its own Gentoo OS.

Thanks,
Jeff


Last edited by jeffk on Mon Aug 25, 2014 7:31 pm; edited 1 time in total
Back to top
View user's profile Send private message
creaker
Guru
Guru


Joined: 14 Jul 2012
Posts: 575

PostPosted: Mon Aug 25, 2014 6:58 pm    Post subject: Reply with quote

you can do it (adding to sudoers) not with visudo only:

Quote:
echo "username ALL=(ALL) ALL" >> /etc/sudoers


Regarding to su permissions, check it out: whether your user in "wheel" group or not?
If no, add you user to this group. It requires for su.

Added:
To be able to edit these files, you have to be logged as root. You can do it from console: press Alt+Ctrl+F1, log in as root and proceed
_________________
Intel Core i3-2120 / 4Gb RAM / 250Gb HDD / NVidia GeForce-550Ti
Back to top
View user's profile Send private message
jeffk
Guru
Guru


Joined: 13 Sep 2003
Posts: 587

PostPosted: Mon Aug 25, 2014 7:31 pm    Post subject: Reply with quote

Solved, pilot error. While trying to get nullmailer to work:

nullmailer-1.13 how to use /usr/sbin/sendmail without sudo?

I applied usermod -G nullmail , and forgot the all-important -a to preserve existing groups.

root login still worked, so I didn't have to go all the way down to systemrescuecd, just out of X and to the console. Restored user to group wheel, which fixed it.

Jeff[/b]
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum