DevHeads.net

Permissions on /etc/sudoers messed up - reflash?

I chmod 0640'ed /etc/sudoers on my N900 and closed the terminal -.-
sudo gainroot/chmod/... fails complaining about the permissions, the gui
package manager does so silently.
Can't mount the filesystem root offline on another device to chmod 0440
back (?), can't login as root locally, ssh to localhost seems to work but I
don't have the slightest idea about the root password.

Any way to avoid a reflash?

Comments

Re: Permissions on /etc/sudoers messed up - reflash?

By Paul Hartman at 01/21/2011 - 20:03

On Fri, Jan 21, 2011 at 5:29 PM, Philipp Haselwarter
<philipp. ... at gmx dot de> wrote:
The root password should be the one you created when you installed the
rootsh package. If you forgot it, then...

I have not tried it, but you might be able to use a rescue initrd like
the one described here to gain access to your rootfs:
<a href="http://wiki.meego.com/ARM/N900/Using_Rescue_Initrd" title="http://wiki.meego.com/ARM/N900/Using_Rescue_Initrd">http://wiki.meego.com/ARM/N900/Using_Rescue_Initrd</a>

There are also a few things that could have helped, had you installed
them ahead of time, like backupmenu, or if you have NITdroid or MeeGo
in a dual-boot environment you might be able to use them to edit your
file permissions.

Good luck!

Re: Permissions on /etc/sudoers messed up - reflash?

By Philipp Haselwarter at 01/24/2011 - 08:07

"PH" == Paul Hartman <paul.hartman+ ... at gmail dot com> writes:

PH> On Fri, Jan 21, 2011 at 5:29 PM, Philipp Haselwarter
PH> <philipp. ... at gmx dot de> wrote:
PH> The root password should be the one you created when you installed
PH> the rootsh package. If you forgot it, then...

...I'm kind of screwed, right.

PH> I have not tried it, but you might be able to use a rescue initrd
PH> like the one described here to gain access to your rootfs:
PH> <a href="http://wiki.meego.com/ARM/N900/Using_Rescue_Initrd" title="http://wiki.meego.com/ARM/N900/Using_Rescue_Initrd">http://wiki.meego.com/ARM/N900/Using_Rescue_Initrd</a>

Got it booted, but it seems that the rescue initrd doesn't contain
chmod. Too bad.

Furthermore I had a really hard time with the keyboard;
the only keys I was able to use were [a-zA-Z<>], no dashes, no slashes
(the modifier key seems to just get ignored).
Maybe I could use the chmod on the rootfs? Still, if I can neither type
"-w" nor "440" that's no use.

PH> There are also a few things that could have helped, had you
PH> installed them ahead of time, like backupmenu, or if you have
PH> NITdroid or MeeGo in a dual-boot environment you might be able to
PH> use them to edit your file permissions.

PH> Good luck!

thanks!

Re: Permissions on /etc/sudoers messed up - reflash?

By Tuomo Tanskanen at 01/22/2011 - 03:16

Hi!

rootsh package does not modify root password, but openssh does.

Cheers, Tumi

Re: Permissions on /etc/sudoers messed up - reflash?

By Matan Ziv-Av at 01/21/2011 - 19:49

You can boot another system. For example Meego:

1. Download any u-boot image (for example the one from here:
<a href="http://al.robotfuzz.com/~al/maemo/u-boot/u-boot.bin" title="http://al.robotfuzz.com/~al/maemo/u-boot/u-boot.bin">http://al.robotfuzz.com/~al/maemo/u-boot/u-boot.bin</a> ) and flash it
(as a kernel):

flasher-3.5 -f -k u-boot.bin

2. Prepare a uSD card for meego according to instructions here:
<a href="http://wiki.meego.com/ARM/N900/Install/MMC" title="http://wiki.meego.com/ARM/N900/Install/MMC">http://wiki.meego.com/ARM/N900/Install/MMC</a>

3. Boot into meego, mount the N900 root filesystem (ubifs on mtd5), and
fix the problem

4. Reflash kernel by downloading the firmware image and using the
command

flasher-3.5 -f -F RX-51_2009SE_20.2010.36-2_PR_COMBINED_MR0_ARM.bin --flash-only=kernel

Re: Permissions on /etc/sudoers messed up - reflash?

By Philipp Haselwarter at 01/24/2011 - 08:09

"MZ" == Matan Ziv-Av < ... at svgalib dot org> writes:
---8<---[snipped 11 lines]---8<---

MZ> You can boot another system. For example Meego:

MZ> 1. Download any u-boot image (for example the one from here:
MZ> <a href="http://al.robotfuzz.com/~al/maemo/u-boot/u-boot.bin" title="http://al.robotfuzz.com/~al/maemo/u-boot/u-boot.bin">http://al.robotfuzz.com/~al/maemo/u-boot/u-boot.bin</a> ) and flash it
MZ> (as a kernel):

MZ> flasher-3.5 -f -k u-boot.bin

MZ> 2. Prepare a uSD card for meego according to instructions here:
MZ> <a href="http://wiki.meego.com/ARM/N900/Install/MMC" title="http://wiki.meego.com/ARM/N900/Install/MMC">http://wiki.meego.com/ARM/N900/Install/MMC</a>

Right now I'm trying to get someone to borrow me a microSD card that can
hold the image; the smallest one seems to be ~1.8GB and I only have a
1GB card.
Are there smaller images available that I missed?

MZ> 3. Boot into meego, mount the N900 root filesystem (ubifs on mtd5),
MZ> and fix the problem

MZ> 4. Reflash kernel by downloading the firmware image and using the
MZ> command

MZ> flasher-3.5 -f -F RX-51_2009SE_20.2010.36-2_PR_COMBINED_MR0_ARM.bin
MZ> --flash-only=kernel

Re: Permissions on /etc/sudoers messed up - reflash?

By Philipp Haselwarter at 01/26/2011 - 06:36

To wrap it up:
Meego let me down, I finally reflashed.
The problem was the ubifs used on the maemo root. Couldn't get it mounted
in meego.
Most of the backup-restore worked fine, a bunch of apps are missing.

So, no way to access the rootfs without maemo; mission failed.