OPNsense Forum

English Forums => General Discussion => Topic started by: michaelgo on October 06, 2021, 08:39:36 AM

Title: change default root password
Post by: michaelgo on October 06, 2021, 08:39:36 AM
Where can i change default root password?
so even after reset it would default to different password than 'opnsense'?
thanks
Title: Re: change default root password
Post by: bartjsmit on October 06, 2021, 10:12:49 AM
Are you running a live version of OPNsense perhaps?

From the docs: https://docs.opnsense.org/manual/install.html

   To invoke the installer login with user installer and password opnsense

After installing the software on a local drive you will be asked to set/change your root password.

Bart...
Title: Re: change default root password
Post by: michaelgo on October 06, 2021, 10:16:22 AM
thank you,
what i mean is actually after installation.
Change the default password the shell script 3) resets to...
Title: Re: change default root password
Post by: Patrick M. Hausen on October 06, 2021, 11:33:56 AM
In the UI: System > Access > Users.
Title: Re: change default root password
Post by: michaelgo on October 06, 2021, 12:29:33 PM
is there a way to change from CLI?
Title: Re: change default root password
Post by: bartjsmit on October 06, 2021, 01:44:05 PM
Quote from: michaelgo on October 06, 2021, 12:29:33 PM
is there a way to change from CLI?

Connect to the console, option 3
Title: Re: change default root password
Post by: Patrick M. Hausen on October 06, 2021, 03:58:43 PM
Login via SSH, and if you are using an interactive shell for your user, invoke `opnsense-shell` first. That gives you the familiar console menu.
Title: Re: change default root password
Post by: franco on October 07, 2021, 08:02:36 AM
Actually, /usr/local/etc/config.xml holds the default configuration in case of factory reset, but that is option (4). Simply replacing this configuration file with any other config.xml makes that the factory reset default with users, passwords and other configurations set accordingly.

Option (3) does not set "opnsense" as the password as you can input your own.

Cheers,
Franco
Title: Re: change default root password
Post by: michaelgo on October 07, 2021, 10:56:19 AM
@franco
thank you so much, this is the answer i've been looking for
Title: Re: change default root password
Post by: michaelgo on October 07, 2021, 12:14:42 PM
is it bcrypt encoded in config.xml?
Title: Re: change default root password
Post by: franco on October 07, 2021, 01:20:22 PM
Ye but any sort of password hash in proper format will work. You can just add a new user with the desired password and look at /conf/config.xml to copy it from.


Cheers,
Franco