OPNsense Forum

English Forums => Zenarmor (Sensei) => Topic started by: Vharry on October 09, 2023, 08:25:37 AM

Title: change hostname and password of the firewall in build
Post by: Vharry on October 09, 2023, 08:25:37 AM
For my opnsense firewall I was trying to include my custom name as a hostname like, vharry.localdomain. Does anyone knows which variable to change in which repository, so that I can get my custom name as hostname after installing the ISO.

Also, I wanted to change the default password. Kindly Help me to achieve this.
Title: Re: change hostname and password of the firewall in build
Post by: almodovaris on October 09, 2023, 08:42:00 AM
System: Settings: General. First two options are host name and domain name.

System: Access: Users. Push  the edit button to change root password.
Title: Re: change hostname and password of the firewall in build
Post by: vivekmauli14 on October 09, 2023, 08:46:56 AM
Thanks for your quick response almodovaris,
Actually I need to change the hostname of the machine at the time of build. So that I can get those changes in my ISO. Please help on how can I achieve this. Which repository creates the Hostname and password for the firewall?

Thanks!
Title: Re: change hostname and password of the firewall in build
Post by: Patrick M. Hausen on October 09, 2023, 09:15:10 AM
It's in the file /usr/local/etc/config.xml in the generated installation. Probably the source for that is:

https://github.com/opnsense/core/blob/master/src/etc/config.xml.sample
Title: Re: change hostname and password of the firewall in build
Post by: vivekmauli14 on October 09, 2023, 11:53:12 AM
Thank you Patrick!

I checked changing the hostname and hashed password from line 206 of config.xml.sample, but it didn't work. Please let me know if you are aware of any other file or step in the process.

Thanks,
Vivek