![]() |
SlugOS.ResetRootPasswordOnInternalFlash HistoryHide minor edits - Show changes to markup May 11, 2008, at 12:17 AM
by -- Add title
Changed lines 1-2 from:
How to Reset the Root Password on the Internal Flash for SlugOSto:
(:title How to Reset the Root Password on the Internal Flash for SlugOS:) May 11, 2008, at 12:16 AM
by -- 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 SlugOSWhyOccasionally, 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 HowChanged 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 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 Changed line 15 from:
Next change the root password by using the "passwd" command: to:
Next change the root password by using the 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 Changed line 22 from:
Or by explicitly remounting "/initrd" read-only: to:
Or by explicitly remounting May 11, 2008, at 12:09 AM
by -- 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 |