Solved

How to reset root password in UNIX FreeBSD

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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Sweet32 Vulnerability in Microsoft IIS7.5 6 424
How to make a Bash alias that takes parameters 5 56
Retreiving column names in Windows but not in Unix 11 47
is this a virus? 3 44
No security measures warrant 100% as a "silver bullet". The truth is we also cannot assume anything but a defensive and vigilance posture. Adopt no trust by default and reveal in assumption. Only assume anonymity or invisibility in the reverse. Safe…
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 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.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

832 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