Solved

How to reset root password in UNIX FreeBSD

Posted on 2013-01-13
3
790 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 77

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

The term "Bad USB" is a buzz word that is usually used when talking about attacks on computer systems that involve USB devices. In this article, I will show what possibilities modern windows systems (win8.x and win10) offer to fight these attacks wi…
Security measures require Windows be logged in using Standard User login (not Administrator).  Yet, sometimes an application has to be run “As Administrator” from a Standard User login.  This paper describes how to create a shortcut icon to launch a…
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…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

789 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