Solved

How to reset root password in UNIX FreeBSD

Posted on 2013-01-13
3
799 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Learn by Doing. Anytime. Anywhere.

Do you like to learn by doing?
Our labs and exercises give you the chance to do just that: Learn by performing actions on real environments.

Hands-on, scenario-based labs give you experience on real environments provided by us so you don't have to worry about breaking anything.

Question has a verified solution.

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

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
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 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…

696 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