Solved

How to reset root password in UNIX FreeBSD

Posted on 2013-01-13
3
783 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
Comment Utility
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 76

Accepted Solution

by:
arnold earned 250 total points
Comment Utility
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
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

The purpose of this article is to demonstrate how we can use conditional statements using Python.
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

743 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now