Solved

How to reset root password in UNIX FreeBSD

Posted on 2013-01-13
3
793 Views
Last Modified: 2016-02-11
i have just taken over from another tech and have been presented with an old FreeBSD server box to which they don't have the root password.

Once the server boots up I am presented with some gibberish copyright and security wording, afterwhich there is a prompt to type in my username.

I type root, then I am asked for the password.

I have tried to boot into recovery mode, however I still get asked to authenticate before I can do anything.

How can i resolve this?
0
Comment
Question by:cgruber
3 Comments
 
LVL 10

Assisted Solution

by:abbright
abbright earned 250 total points
ID: 38773434
By booting using a recovery CD you'd have access to the /etc/passwd and /etc/shadow files which should allow you to reset the password.
Another option would be to put the root-harddisk into another (UNIX) server and access these files that way.
0
 
LVL 78

Accepted Solution

by:
arnold earned 250 total points
ID: 38775273
Along the lines referenced by abbright, do you have any access to the system with an unprivileged account to see the file system layout and file type.
It makes things simpler I.e. you know the file system layout and setup so that when you bootup the system using a CD/DVD you can mount the filesystem where /etc/shadow is or if the system has sudo, adjust /etc/sudoers to grant rights elevation to the account with which you have access if it does not have it already.
0
 
LVL 1

Expert Comment

by:sbayrak
ID: 39488037
Start your FreeBSD server.
Press key 4 when “FreeBSD boot menu” is presented.

Next you will see the following prompt;

Enter full pathname of shell or RETURN for /bin/sh:
Press enter and you will be dropped into single-user mode without a question.

Now you have to mount all filesystems listed in /etc/fstab;

# mount -a
Set a new root password by issuing passwd command;

# passwd
Changing local password for root
New Password:
Retype New Password:
There is no need to reboot your system. The exit command will make the system immediately return to multi-user mode;

# exit

- See my article for more: http://www.ipsure.com/blog/2011/securing-freebsd-console-how-to-reset-and-recover-lost-root-password/
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
lunix and unix command 21 120
RHEL 6.7 Gnome Desktop on VMware 6 VM 9 114
python - find anything after $ question. 9 52
RPM creation 6 24
In a recent article here at Experts Exchange (http://www.experts-exchange.com/articles/18880/PaperPort-14-in-Windows-10-A-First-Look.html), I discussed my nine-month sandbox testing of the Windows 10 Technical Preview, specifically with respect to r…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question