Page 1 of 1

How to enable/disable root access

PostPosted: Tue Oct 18, 2011 8:03 am
by ajaygarg
Hi all.

I have a XO-1, running kernel 2.6.31_xo. I wish to enable/disable the root access (currently, the root access is enabled).

The normal process of changing the root password using "passwd" doesn't seem to work. If it is tried, the 'olpc' user is able to switch to root, without being asked for the password. The approach works in the "standard" fc14 kernel, though.

Is there a way to do this for the XO kernel, without requiring any change in the kernel code itself?

Looking forward to a reply.


Thanks and Regards,
Ajay

Re: How to enable/disable root access

PostPosted: Tue Oct 18, 2011 4:53 pm
by ektoric
Do this carefully, obviously, as if you loose root access, you'll be out of luck until you perform a USB clean install (and this only if you have already received the developer key).

As root, run "visudo"
1) Check there isn't a line that allows olpc user to run any command without password
2) Check for any groups that are allowed to run any command without password
2a) Afterwards, check if olpc user is in any of these groups: "vi /etc/groups"

Let us know if this solves your problem!

Re: How to enable/disable root access

PostPosted: Wed Oct 19, 2011 1:52 am
by ajaygarg
Hi ektoric. Thanks for the reply.

1. visudo does not contain any line that allows "olpc" user to run any command without password.

2. visudo does contains a line
Code: Select all
<percentage sign>wheel ALL=(ALL) NOPASSWD: ALL


In /etc/group, there is a line
Code: Select all
<percentage sign>wheel:x:10:root,olpc


So, I commented the first line (logged in as root), as
Code: Select all
#<percentage sign>wheel ALL=(ALL) NOPASSWD: ALL


Immediately after, I reset the "olpc" and "root" passwords.

and it gave me 50% results :

1. Now, running "sudo <command>" from "olpc" login gives me "olpc not in sudoers file". Fine. Works as expected.

2. However, from "olpc" login, when i do "su -", it does not ask me for a password.

The second case, is as good as not solving the problem at all :-(


What may I look into further?

Looking forward to a reply.

Regards,
Ajay

Re: How to enable/disable root access

PostPosted: Thu Oct 20, 2011 3:45 pm
by ektoric
ajaygarg wrote:2. However, from "olpc" login, when i do "su -", it does not ask me for a password.


What happens if you change the root password?
Code: Select all
olpc $ su -
root # passwd
# set the root user's password
root # exit
olpc $ su -

Re: How to enable/disable root access

PostPosted: Thu Dec 12, 2013 2:44 am
by Abbysam
The OLPC uses Open Firmware as the startup firmware. Instead of auto-booting into the Sugar (linux) operating system, you can ESC out into the firmware's environment and perform actions at its "OK" prompt.