NSLU2-Linux
view · edit · print · history

SlugOS.ResetRootPasswordOnInternalFlash History

Hide minor edits - Show changes to markup

May 11, 2008, at 12:17 AM by jchau -- Add title
Changed lines 1-2 from:

How to Reset the Root Password on the Internal Flash for SlugOS

to:

(:title How to Reset the Root Password on the Internal Flash for SlugOS:)

May 11, 2008, at 12:16 AM by jchau -- Fix formatting
Changed lines 1-6 from:

== How to Reset the Root Password on the Internal Flash for SlugOS ==

=== Why === Occasionally, it may be desirable to login to a Slug without any external drives attached (such as for maintenance purposes). In order to do this, the root password stored (as a hash) on the internal flash is needed. However, if after using turnup to switch to an external drive, the root password is changed, then the root password (hash) stored on the internal flash may be different than the root password normally used. (The passwd file in the internal flash is no longer the same as the passwd (or shadow) file on the external drive.) In this scenario, the original root password may be forgotten through disuse.

=== How ===

to:

How to Reset the Root Password on the Internal Flash for SlugOS

Why

Occasionally, it may be desirable to login to a Slug without any external drives attached (such as for maintenance purposes). In order to do this, the root password stored (as a hash) on the internal flash is needed. However, if after using turnup to switch to an external drive, the root password is changed, then the root password (hash) stored on the internal flash may be different than the root password normally used. (The passwd file in the internal flash is no longer the same as the passwd (or shadow) file on the external drive.) In this scenario, the original root password may be forgotten through disuse.

How

Changed line 9 from:

The internal flash should already be mounted as "/initrd", but it is mounted as read-only. Since you will need to make changes to "/initrd/etc/passwd" (the passwd file on the internal flash), remount it read-write:

to:

The internal flash should already be mounted as /initrd, but it is mounted as read-only. Since you will need to make changes to /initrd/etc/passwd (the passwd file on the internal flash), remount it read-write:

Changed line 12 from:

Then chroot into the internal flash so that your Slug thinks that "/initrd" is actually the root partition:

to:

Then chroot into the internal flash so that your Slug thinks that /initrd is actually the /:

Changed line 15 from:

Next change the root password by using the "passwd" command:

to:

Next change the root password by using the passwd command:

Changed line 20 from:

You may want to set "/initrd" back to read-only to avoid accidentally corrupting it. This can be accomplished by rebooting your Slug:

to:

You may want to set /initrd back to read-only to avoid accidentally corrupting it. This can be accomplished by rebooting your Slug:

Changed line 22 from:

Or by explicitly remounting "/initrd" read-only:

to:

Or by explicitly remounting /initrd read-only:

May 11, 2008, at 12:09 AM by jchau -- Create the article with basic formatting
Added lines 1-23:

== How to Reset the Root Password on the Internal Flash for SlugOS ==

=== Why === Occasionally, it may be desirable to login to a Slug without any external drives attached (such as for maintenance purposes). In order to do this, the root password stored (as a hash) on the internal flash is needed. However, if after using turnup to switch to an external drive, the root password is changed, then the root password (hash) stored on the internal flash may be different than the root password normally used. (The passwd file in the internal flash is no longer the same as the passwd (or shadow) file on the external drive.) In this scenario, the original root password may be forgotten through disuse.

=== How === To reset the root password hash stored on the internal flash, first boot the system normally with the external drive (the one with the root partition) attached. Then login to root normally.

The internal flash should already be mounted as "/initrd", but it is mounted as read-only. Since you will need to make changes to "/initrd/etc/passwd" (the passwd file on the internal flash), remount it read-write:

 mount -o remount,rw /initrd

Then chroot into the internal flash so that your Slug thinks that "/initrd" is actually the root partition:

 chroot /initrd

Next change the root password by using the "passwd" command:

 passwd root

When you have finished that, the root password hash stored on the internal flash has been changed. You can leave the chroot jail by pressing [Ctrl]+[D].

You may want to set "/initrd" back to read-only to avoid accidentally corrupting it. This can be accomplished by rebooting your Slug:

 shutdown -r now

Or by explicitly remounting "/initrd" read-only:

 mount -o remount,ro /initrd
view · edit · print · history · Last edited by jchau.
Originally by jchau.
Page last modified on May 11, 2008, at 12:17 AM