Monday, April 21, 2008

Gumstix - Forgotten the root password?

If you need to reset the root password on your Gumstix and don't want to reflash it you have to run Linux in single user mode. You do this by replacing the normal initialisation program with the shell.

Change the standard bootargs (your line may differ from mine) from:
bootargs=console=ttyS0,115200n8 root=1f01 rootfstype=jffs2 reboot=cold,hard
bootargs=console=ttyS0,115200n8 root=1f01 rootfstype=jffs2 reboot=cold,hard init=/bin/sh
NB: The above bootargs lines are single lines, they have been wrapped by the browser.

You can change the line and reboot with the commands:

GUM> setenv bootargs $bootargs init=/bin/sh
GUM> boot

When the kernel boots you will be presented with a shell prompt, you can change the password using the passwd command.  Here is the output when changing the password to gumstix.  The word gumstix will not actually be echoed back to you but I have shown it here to show where it is entered.

$ passwd
Changing password for root
Enter the new password (minimum of 5, maximum of 8 characters)
Please use a combination of upper and lower case letters and numbers.
Enter new password: gumstix
Bad password: too simple.

Warning: weak password (continuing).
Re-enter new password: gumstix
Password changed.
$ reboot

No comments: