geekvenue.net

Welcome to Chucktips Hardware HELP WITH DEAD OS Installing FreeBSD Miscellaneous
 faq
 search
 add article
 cool-stuff
 how-to
 main
 tips


HOWTO: Recover lost root password
HELP WITH DEAD OS Posted by Jason on Friday October 05, @02:31PM
from the got-root? dept.
Got root? Or more to the point forgot root?

I think we all know what a terrible feeling it is to be locked out of our home or auto. It's even worse when you have forgotten the root password to your unix box.

No need to worry. It can be recovered.


In order to recover your root password, you must boot FreeBSD in single user mode, mount the filesystems read/write and issue the passwd command. The passwd command will not actually recover your root password, but will allow you to change it to something new.


[Boot in single user mode]

As the operating system is starting, it will display the following message:

Hit [Enter] to boot immediately, or any other key for command prompt.

Booting [kernel] in 10 seconds...


You should now press the space bar, and you will see the following message:

Type '?' for a list of commands, or 'help' for more detailed help.

ok


Now type boot -s and press the enter key to start FreeBSD in single user mode. After the system boots, you should see the statement:

Enter full pathname of shell or RETURN for /bin/sh:

Press the enter key and you will have a # prompt.


[Mount the filesystems]

At the command prompt, issue the mount command. This command will mount all the filesystems listed in your /etc/fstab file.

# mount -t ufs -a


[Change the root password]
Issue the passwd command and you will be prompted to enter a new password for the root account.

# passwd

New password:_
Retype new password:_
passwd: updating the database...
passwd: done

# exit

There is no need to reboot the operating system to go to multi-user mode. The exit command will cause the system to return to multi-user mode without a reboot.



To learn more about the passwd command and other commands, refer to their man pages:
man passwd
man mount
man exit

Add Reply

If this is a genuine post please ignore this field:

Name
Email
Notify Notify me via email of responses to this message
Title
Comment
(Check those URLs! Don't forget the http://!)
Encoding
If none of the above mean anything to you, select 'Plain'!
Attachment
(You can attach a file to your reply which can then be retrieved by other readers.
Try to keep the file sizes below 500Kb in order to conserve network and server resources.)
Allowed HTML <B> <I> <P> <A> <LI> <OL> <UL> <EM> <BR> <TT> <HR> <STRONG> <BLOCKQUOTE> <DIV .*> <DIV> <P .*>
Important Stuff:
  • Note: Fields with bold titles are required.
  • Please try to keep posts on topic.
  • Try to reply to other people comments instead of starting new threads,
  • Read other people's messages before posting your own to avoid simply duplicating what has already been said.
  • Use a clear subject that describes what your message is about.
  • Please do not post offtopic, inflammatory, inappropriate, illegal, or offensive comments. Repeat offenders will be sanctioned.
  • "You never know how many friends you have until you own a Condo on the beach." -- Jason's Postulate

    Powered by Zope  Powered by Apache  Squishdot Powered
    All trademarks and copyrights on this page are owned by their respective companies. Comments are owned by the Poster. The Rest ©2001 Jason Neumann.
    [ main | post article | search ]