How to enable/disable root access

Share uncovered secrets, useful notes, guides and hacks!

How to enable/disable root access

Postby ajaygarg » Tue Oct 18, 2011 8:03 am

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
ajaygarg
 
Posts: 3
Joined: Tue Oct 18, 2011 7:57 am

Re: How to enable/disable root access

Postby ektoric » Tue Oct 18, 2011 4:53 pm

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!
ektoric
Support Team
 
Posts: 470
Joined: Wed Jan 02, 2008 3:46 pm
Location: Austin, TX

Re: How to enable/disable root access

Postby ajaygarg » Wed Oct 19, 2011 1:52 am

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
ajaygarg
 
Posts: 3
Joined: Tue Oct 18, 2011 7:57 am

Re: How to enable/disable root access

Postby ektoric » Thu Oct 20, 2011 3:45 pm

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 -
ektoric
Support Team
 
Posts: 470
Joined: Wed Jan 02, 2008 3:46 pm
Location: Austin, TX

Re: How to enable/disable root access

Postby Abbysam » Thu Dec 12, 2013 2:44 am

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.
***aLiZzz***
Abbysam
 
Posts: 1
Joined: Thu Dec 12, 2013 2:39 am


Return to Tips, Tricks & Tutorials

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron