[maemo-users] Can I do root; then passwd to change root password?

From: Dave Neary dneary at maemo.org
Date: Thu Oct 21 10:29:48 EEST 2010
Hi,

Oleg Hahm wrote:
>>> Am Thu, Oct 21, 2010 at 08:35:47AM +0530 schrieb Avinash Joshi:
>>>> ~ $ sudo gainroot
>>> in this context I've got another question:
>>> I've never understood why I should use gainroot instead of simply typing
>>> `sudo
>>> su`. Is there any difference?

There are a few ways to open a root shell in Linux using su / sudo.

sudo -s (this is my preferred method, it just says "open a shell")
sudo su (run su as root - I don't like this, since it's doing the same
thing twice, but some people use this)
sudo /bin/sh

They all rely on sudo to change the UID, and they all depend on having
sufficient privileges in the sudoers file for the unprivileged user.

You can get more details about the specifics of becoming root on Maemo
here: http://wiki.maemo.org/Root_access

And some of the history in this older talk thread:
http://talk.maemo.org/showthread.php?t=33911

The short version is that gainroot was left as a back-door for
developers when the device was put in R&D mode. Installing ssh-server
allows you to set a root password at install time, and you can avoid
sudo altogether. Installing rootsh provides you with a gainroot that
works even when your device isn't in R&D mode - this is likely what your
device's previous owner did.

Cheers,
Dave.

-- 
maemo.org docsmaster
Email: dneary at maemo.org
Jabber: bolsh at jabber.org

More information about the maemo-users mailing list