maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   Feel unhappy about "sudo gainroot" not asking for root password? (https://talk.maemo.org/showthread.php?t=62221)

joerg_rw 2010-09-13 18:34

Feel unhappy about "sudo gainroot" not asking for root password?
 
start xterm
become root (if you don't know how, then all this doesn't apply to you anyway)
make sure you have proper root password set!
run command:
Code:

sed -e "s/Defaults env_reset/Defaults env_reset\nDefaults targetpw/; \
 s+user ALL = NOPASSWD: /usr/sbin/gainroot+user ALL = PASSWD: \ /usr/sbin/gainroot+" -i  /etc/sudoers.d/01sudo


run update-sudoers, check there's no warnings or errors

if sudo gainroot still doesn't ask for password, it might be cached from previous entering it: sudo -k clears pw cache

Tested for PR1.2 with default rootsh installed, works for me. If you bork everything, a reinstall of rootsh package should get you out of quicksand

THIS IS ABOUT *ROOT* PASSWORD for root account, not about that silly Ubuntu idiocy to ask for user password to do root things

this is an excerpt of http://wiki.maemo.org/User:Joerg_rw/tools

If you feel this is a useful post, consider hitting the 'Thanks' button over ->there

giannoug 2010-09-13 18:41

Re: Feel unhappy about "sudo gainroot" not asking for root password?
 
I guess you need to setup a password for "user" first.

passwd user in root

zerocool2k 2011-01-25 15:54

Re: Feel unhappy about "sudo gainroot" not asking for root password?
 
Any fix for PR 1.3? It doesn't seem to be working any more. The "sed -e" complained about "unsupported command e", so I added:
Code:

Defaults targetpw
user ALL = PASSWD: /usr/sbin/gainroot

to "/etc/sudoers.d/01sudo"
Did the update and clear cache, but still, it doesn't ask for a password.

leetut 2011-01-25 15:58

Re: Feel unhappy about "sudo gainroot" not asking for root password?
 
nope, im quite happy that it DOESN'T ask me for a password
and i'd be looking for a way to disable it if it did

zerocool2k 2011-01-25 16:06

Re: Feel unhappy about "sudo gainroot" not asking for root password?
 
OK, found it. I need to modify this:
Code:

Defaults env_keep+=GTK_MODULES
user ALL = PASSWD: ALL

in "/etc/sudoers"

gerdich 2011-01-25 21:43

Re: Feel unhappy about "sudo gainroot" not asking for root password?
 
Another possibility:
Uninstall rootsh (or block it with chmod a-x /usr/sbin/gainroot)
Install an ssh-server

login with ssh on your own device:
ssh root@localhost
password:

Radicalz38 2011-01-25 21:57

Re: Feel unhappy about "sudo gainroot" not asking for root password?
 
Quote:

Originally Posted by leetut (Post 928253)
nope, im quite happy that it DOESN'T ask me for a password
and i'd be looking for a way to disable it if it did

Sometimes you have to face it... Not all people are like you

mahousaru 2011-01-26 13:00

Re: Feel unhappy about "sudo gainroot" not asking for root password?
 
Quote:

Originally Posted by joerg_rw (Post 815104)
THIS IS ABOUT *ROOT* PASSWORD for root account, not about that silly Ubuntu idiocy to ask for user password to do root things

Auditability....


All times are GMT. The time now is 06:00.

vBulletin® Version 3.8.8