Utility to recover FreeNAS user name and password

Status
Not open for further replies.

Ryan Smyth

Dabbler
Joined
Nov 20, 2012
Messages
12
Hello All,

First time poster - been using FreeNAS for a while now and love it.

I've written a utility to recover the login for a forgotten FreeNAS login. It is available here:

http://cynic.me/2012/11/21/recover-lost-freenas-user-and-password/

I recently had a problem with my FreeNAS box, and thought that I had forgotten the login. I hadn't actually, but it wouldn't let me login.

At the time, I didn't know that I had a problem, which is why I wrote the utility. Details are available at the link above.

Anyways, I thought I'd just release the program for anyone that might find it useful. Source code is included, and in the public domain.

Cheers,

Ryan
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
If you just go to the machine locally you can just reset the password.

I'm really at a loss to think of when I'd need to use such a program personally.

But thanks for providing it. It may be useful to someone someday.
 

Ryan Smyth

Dabbler
Joined
Nov 20, 2012
Messages
12
You do realize if you just go to the machine locally you can reset the password?

I'm really at a loss to think of when I'd need to use such a program.

But thanks for providing it. It may be useful to someone someday.

I had read somewhere that a reset was a ***RESET*** and thought that it might destroy the data or do more harm than good. I wasn't certain about it, so figured this was just a faster and safer way to go about it. I just wasn't sure, and got spooked - I'm highly risk averse to data loss, which is one of the reasons I'm using FreeNAS. (My box is of course set up in RAID.)

i.e. It was simple and fast enough to write. I was worried that I'd spend hours trying to track down an answer, then end up with nothing to show for my time. I knew this would work and knew that in the end, it would be simpler for me with less risk.

Also, I'd have to deal with messing around with cables and keyboards and all that - I just didn't feel like dealing with my cabling nightmare, which was just one more reason to write a quick utility.

I did see something about resetting the password using Python, but it looked like I needed to login first, which kind of defeated the purpose at the time. It was in a forum post or something somewhere - I forget where. Again, I didn't want to play with cables only to find out I had the same predicament. (I really hate cables!)
 

Ryan Smyth

Dabbler
Joined
Nov 20, 2012
Messages
12
Found it:

http://forums.freenas.org/archive/index.php/t-54.html

vlad1966
05-29-2011, 11:59 AM
How can I reset the webGUI Username/Password? I don't see any options anywhere, and nothing in the docs.

Thanks!
jgreco
05-29-2011, 03:41 PM
If you don't mind toasting everything, you can log in on the console and do

% cd /data
% cp factory-v1.db freenas-v1.db
% reboot

which resets you to "factory" defaults - for mostly everything.

There's probably a more elegant way to twiddle with things in the database but I've yet to have a reason to discover what it is.

That was what spooked me. But it also looked like it needed me to login to the machine, and I figured if I couldn't login to the web interface, I'd have the same problem on the machine itself.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Nope. It's option 7 at the local machine "Reset WebGUI login credentials". That resets your admin GUI(not your root account).

Edit: Option 8 is "reset to factory defaults" and that will be like reinstalling FreeNAS. Your zpool data will be okay, but you'll have to import the zpool to access the data.

Option 7 is why I kind of question the value of your utility. All you need is a keyboard and a reset is just a few keystrokes away. This was by design in case you forgot your password. In fact, someone posted to the forum asking for a way to lock the screen because he was concerned that anyone could walk up to the server and reset the password. He wanted this locked out too. My response was that if someone has physical access to the server then who cares if he can reset a password. He has physical access so he could just bootup from another drive and retrieve the password or just physically take the hard drives. If you are allowing free-for-all physical access to the server it doesn't matter how good your antivirus, firewall, or encryption is. They can get access easily if they really want it.
 

Ryan Smyth

Dabbler
Joined
Nov 20, 2012
Messages
12
Nope. It's option 7 at the local machine "Reset WebGUI login credentials". That resets your admin GUI(not your root account).

Edit: Option 8 is "reset to factory defaults" and that will be like reinstalling FreeNAS. Your zpool data will be okay, but you'll have to import the zpool to access the data.

Option 7 is why I kind of question the value of your utility. All you need is a keyboard and a reset is just a few keystrokes away. This was by design in case you forgot your password. In fact, someone posted to the forum asking for a way to lock the screen because he was concerned that anyone could walk up to the server and reset the password. He wanted this locked out too. My response was that if someone has physical access to the server then who cares if he can reset a password. He has physical access so he could just bootup from another drive and retrieve the password or just physically take the hard drives. If you are allowing free-for-all physical access to the server it doesn't matter how good your antivirus, firewall, or encryption is. They can get access easily if they really want it.

I thought I would have to login to see that menu, so I didn't even bother. (I don't have a keyboard or monitor hooked up to my FreeNAS box.)

Well, I guess the utility is kind of redundant then. It does avoid having to hook up a monitor/keyboard, though it might be a bit more of a pain to use it than actually switch monitors over to the box. Oh well...

Thanks for the info there. I didn't know that you could administer FreeNAS without actually logging in to the root account.
 

meishi

Cadet
Joined
Feb 28, 2012
Messages
1
Mark it, and hope it will be useful someday.:cool: Who was playing Chrono Tales by Ray Media? I heard it will upgrade a Christmas version and the secret BOSS will also appear in the game world at Christmas.
 

dztrbd

Dabbler
Joined
Dec 6, 2013
Messages
36
Thanks for making this. Less hassle than setting up monitors and crap

Sent from my SM-N9005 using Tapatalk
 

warri

Guru
Joined
Jun 6, 2011
Messages
1,193
If you have physical access to the box, chose "Reset WebGUI login credential" in the menu coming up after boot - as documented in the manual.
If you have disabled the menu manually, you might need to re-install FreeNAS.

Also, you shouldn't necro old threads, or the forum watchdog will bite you.
 
Status
Not open for further replies.
Top