set initial username/passwd without using GUI?

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Author Message
lazardo
DD-WRT User


Joined: 17 Apr 2014
Posts: 140
Location: SF Bay Area

PostPosted: Thu Mar 21, 2024 18:51    Post subject: set initial username/passwd without using GUI? Reply with quote
Any way to set initial user/pass after firmware upgrade + factory defaults outside of usual GUI method?

telnet did not work, have not yet tried curl POST.

javascript is undecipherable (to me Smile
Sponsor
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 6447
Location: UK, London, just across the river..

PostPosted: Thu Mar 21, 2024 19:23    Post subject: Reply with quote
nope, after reset you need a GUI to set password and than telnet is enabled...
(i know it sucks, but there is a security reason for it...) back in the days after reset there was
no WAN at all...now its enabled and left to dynamic dhcp...

otherwise one of this methods will do, but you need a CLI (ether telnet or SSh)

nvram set http_passwd=

or

nvram set https_passwd=

nvram commit

or

setuserpasswd root admin

change root and admin to your preference

_________________
Atheros
TP-Link WR740Nv1 ---DD-WRT 55630 WAP
TP-Link WR1043NDv2 -DD-WRT 55723 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 55779 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55819 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55779 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55460 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913
mwchang
DD-WRT Guru


Joined: 26 Mar 2013
Posts: 1858
Location: Hung Hom, Hong Kong

PostPosted: Fri Mar 22, 2024 10:32    Post subject: Re: set initial username/passwd without using GUI? Reply with quote
lazardo wrote:
Any way to set initial user/pass after firmware upgrade + factory defaults outside of usual GUI method?
telnet did not work, have not yet tried curl POST.
javascript is undecipherable (to me Smile

It's not about Javacript nor Telnet. There is something called IRREVERSIBLE encryption or hashing, sometimes with salt. Smile

/etc/passwd irreversible encryption - Google Search
https://www.google.com/search?q=%2Fetc%2Fpasswd+irreversible+encryption

Standard Linux allows you to reset root password using boot-time init option. You have to be at the PC to do it.

OTOH, there are code beautifiers to format Javascript codes so that they are more readable. And DD-WRT got Dropbear SSH which is more secured than Busybox Telnet.

_________________
Router: Asus RT-N18U (rev. A1)

Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!

Facebook: https://www.facebook.com/changmanwai
Website: https://sites.google.com/site/changmw
SETI@Home profile: http://setiathome.berkeley.edu/view_profile.php?userid=211832
GitHub: https://github.com/changmw/changmw
lazardo
DD-WRT User


Joined: 17 Apr 2014
Posts: 140
Location: SF Bay Area

PostPosted: Mon Apr 22, 2024 22:23    Post subject: Reply with quote
Thanks.

The goal was to automate the password setting, so I'll try curl POST.
yoyoma2
DD-WRT User


Joined: 24 Sep 2016
Posts: 373

PostPosted: Tue Apr 23, 2024 3:24    Post subject: Reply with quote
Take a look at easyddup. I used to upgrade the firmware in place with easyddup on a subnet different than the dd-wrt default subnet. See what the easyddup.sh code did when asking "Save & Restore basic settings y/n ? " which used to save & restore network settings, username and password.

I'm sure much of this is out of date but it's worth a look. The the key files were:
easyddup-vars.ini.sample
save-mynvram.sh
restore-mynvram.sh

Recently even /sbin/reboot was not accessible after firmware write so restore-mynvram.sh probably isn't either.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum