Reset web interface password through ssh

Post new topic   This topic is locked: you cannot edit posts or make replies.    DD-WRT Forum Index -> General Questions
Goto page 1, 2  Next
Author Message
DirtyBeets
DD-WRT Novice


Joined: 26 Mar 2011
Posts: 3

PostPosted: Sat May 21, 2011 15:13    Post subject: Reset web interface password through ssh Reply with quote
I have no idea what happened but my router will not let me into the web interface. I can get in through ssh though.

Is it possible to set the password for the web interface through ssh?

EDIT: Not sure if it makes a difference but I've got an Asus RT-N16 running the Big package.
Sponsor
PetervdM
DD-WRT User


Joined: 11 Jun 2009
Posts: 282
Location: EU

PostPosted: Sat May 21, 2011 15:41    Post subject: Reply with quote
if you can login by ssh, your password is right!
the username for ssh is always 'root' ( without quotes ), the default username for the webinterface is 'admin' ( also without quotes ), which has the same password as root in ssh. did you use 'admin'? if you altered the default username, you are in trouble i guess..

_________________
now running tomato by shibby
E4200v1 cfe 2010.09.20.0


Last edited by PetervdM on Sat May 21, 2011 15:47; edited 1 time in total
DirtyBeets
DD-WRT Novice


Joined: 26 Mar 2011
Posts: 3

PostPosted: Sat May 21, 2011 15:43    Post subject: Reply with quote
That's what I thought too but it just would not let me in. I tried every password I use but nothing would take.


Found it. In case anyone else needs to know here's how.

Code:
setuserpasswd username password
Hossy
DD-WRT Novice


Joined: 10 Jul 2008
Posts: 10

PostPosted: Wed Jul 11, 2012 2:51    Post subject: Reply with quote
DirtyBeets wrote:
That's what I thought too but it just would not let me in. I tried every password I use but nothing would take.


Found it. In case anyone else needs to know here's how.

Code:
setuserpasswd username password


Thanks!! This fixed my router. I had the same problem. I could login to SSH, but not the web interface. Running v24-sp1.
sw2091t
DD-WRT Novice


Joined: 09 Jul 2011
Posts: 8
Location: NJ

PostPosted: Wed May 15, 2013 2:52    Post subject: Thanks again Reply with quote
Looks like this thread is useful to someone at least once a year, lol. I changed my password a couple times recently using LastPass to generate and store new passwords but somehow it got messed up so I couldn't log in. However, I use key file authentication for SSH so I could get in and fix it from there without my password. Thanks for posting your solution OP!
pyThat
DD-WRT Novice


Joined: 28 Jul 2012
Posts: 34

PostPosted: Tue Jul 16, 2013 0:18    Post subject: Reply with quote
THANK YOU !!!!! you saved my life
zen0n
DD-WRT Novice


Joined: 23 Dec 2013
Posts: 5

PostPosted: Thu Dec 26, 2013 2:34    Post subject: Reply with quote
DING, exactly what I was looking for. Forgot password but had my ssh key saved. Worked like a charm.
yutoon
DD-WRT User


Joined: 15 Jul 2010
Posts: 60

PostPosted: Tue Apr 07, 2015 14:34    Post subject: Reply with quote
Update: Still works.

Now to figure out why it was needed to begin with.
WhyComputer
DD-WRT Novice


Joined: 20 Nov 2008
Posts: 6

PostPosted: Tue Apr 21, 2015 18:40    Post subject: Lockfile Reply with quote
I did not forget the password but unchecked the https option under Administration. Https is broken for my router at the moment and I was thinking to repurpose 443 for OpenVPN.
Anyway, after resetting the password (to the same) it displayed "removing lock file" in the shell.

I suspect the issue is a lock file of some sort, at least in my case.
amitl
DD-WRT Novice


Joined: 29 May 2013
Posts: 6

PostPosted: Thu Jul 02, 2015 10:18    Post subject: Reply with quote
Hi All,

Seems like this command can help. Please can someone give me the commands on how to use this with my router.

I have lost my router control panel password and am unable to get through. Need help with using ssh commands on Mac to setup.

Appreciate it

Thanks
Murrkf
DD-WRT Guru


Joined: 22 Sep 2008
Posts: 12675

PostPosted: Thu Jul 02, 2015 11:12    Post subject: Reply with quote
You need your passphrase and ssh terminal. You can't reset your passphrase without the existing passphrase. That is what the reset button is for. Use it. If you still need assistance, please see the first post in this forum. Reset techniques are router dependent.
_________________
SIG:
I'm trying to teach you to fish, not give you a fish. If you just want a fish, wait for a fisherman who hands them out. I'm more of a fishing instructor.
LOM: "If you show that you have not bothered to read the forum announcements or to follow the advices in them then the level of help available for you will drop substantially, also known as Murrkf's law.."
MoonLaf
DD-WRT Novice


Joined: 28 Nov 2015
Posts: 7

PostPosted: Sun Aug 07, 2016 16:13    Post subject: Reply with quote
Thanks for this Thread!

It seems that I've changed the username in web interface and couldn't remember it.

I tried the password I knew in SSH and then used the above code to reset my web interface username and password and it worked.

Kind Regards,
maguirreg
DD-WRT Novice


Joined: 25 Oct 2016
Posts: 1

PostPosted: Tue Oct 25, 2016 18:13    Post subject: Reply with quote
yutoon wrote:
Update: Still works.

Now to figure out why it was needed to begin with.


Still works... for some weird reason, the authentication fails with the right password. I just execute the command in the terminal, with the same exact password the router has, and the web is on duty again!

Thanks!
viper_iii
DD-WRT Novice


Joined: 09 Jun 2006
Posts: 8

PostPosted: Sun Mar 24, 2019 19:02    Post subject: Reply with quote
super old 5.5/6 years later and saved me working on a remote outer...

think it was a failed firmware update from:
Firmware: DD-WRT v3.0-r36006 std > current and didn't go well..

rebooted router and seems okay but gui wasn't logging in..
ssh was good so I reset via that and good..

also did a default username reset:
lost that darn link though....
was a nice little
#nvram set http_username al;dfja;ldfjal;sdj random string - worked just fine but only after resetting admin password -
worked in ssh but not gui even after resetting gui user... oh well...

but above worked and got access.
atomicamp
DD-WRT User


Joined: 16 Apr 2018
Posts: 107
Location: Milwaukee, WI

PostPosted: Wed Jan 22, 2020 1:37    Post subject: Reply with quote
Hossy wrote:
DirtyBeets wrote:
That's what I thought too but it just would not let me in. I tried every password I use but nothing would take.


Found it. In case anyone else needs to know here's how.

Code:
setuserpasswd username password


Thanks!! This fixed my router. I had the same problem. I could login to SSH, but not the web interface. Running v24-sp1.


Ditto on that. Exact same issue. Thank God for ssh public and private keys.

_________________
DanRanRocks - Tech Tutorials by Dan Ran

https://github.com/danrancan
dan@danran.rockst
My Blog https://danran.rocks
Join me on key base! and Add me on Keybase

Current Linksys WRT3200acm Firmware "DD-WRT v3.0-r51140 std (12/31/22)
Goto page 1, 2  Next Display posts from previous:    Page 1 of 2
Post new topic   This topic is locked: you cannot edit posts or make replies.    DD-WRT Forum Index -> General Questions 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