Router accessible via ssh but not luci

hello:
i have a router that i can ssh into with l/p but the luci login page fails. i have read several threads on this but haven been able to figure out the issue/resolution.
can anyone help shed light on this please?
thanks, j

What router? Firmware version? post the details:

ubus call system board
df -h

Then, we need logs

/etc/init.d/uhttpd status
/etc/init.d/uhttpd enable
/etc/init.d/uhttpd restart
logread | grep luci
root@OpenWrt:~# ubus call system board
{
	"kernel": "6.6.73",
	"hostname": "OpenWrt",
	"system": "ARMv8 Processor rev 4",
	"model": "GL.iNet GL-MT3000",
	"board_name": "glinet,gl-mt3000",
	"rootfs_type": "squashfs",
	"release": {
		"distribution": "OpenWrt",
		"version": "24.10.0",
		"revision": "r28427-6df0e3d02a",
		"target": "mediatek/filogic",
		"description": "OpenWrt 24.10.0 r28427-6df0e3d02a",
		"builddate": "1738624177"
	}
}
root@OpenWrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 4.8M      4.8M         0 100% /rom
tmpfs                   242.9M    168.0K    242.8M   0% /tmp
/dev/ubi0_2             205.3M     64.0K    200.5M   0% /overlay
overlayfs:/overlay      205.3M     64.0K    200.5M   0% /
tmpfs                   512.0K         0    512.0K   0% /dev
root@OpenWrt:~# etc/init.d/uhttpd status
-ash: etc/init.d/uhttpd: not found
root@OpenWrt:~# /etc/init.d/uhttpd enable
root@OpenWrt:~# /etc/init.d/uhttpd restart
root@OpenWrt:~# logread | grep luci
Mon Feb  3 23:18:57 2025 user.notice ucitrack: Setting up /etc/config/luci-splash reload dependency on /etc/config/firewall
Mon Feb  3 23:18:57 2025 user.notice ucitrack: Setting up /etc/config/luci_statistics reload dependency on /etc/config/system

thanks, alan :grinning_face:

Do you see the login page in the browser or the login authentication fails?
What does this say?

netstat -lnp | grep uhttp
ps w | grep uhttp

i do see the login page, but i get an "Invalid username and/or password! Please try again." message.

root@OpenWrt:~# netstat -lnp | grep uhttp
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      1935/uhttpd
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      1935/uhttpd
tcp        0      0 :::80                   :::*                    LISTEN      1935/uhttpd
tcp        0      0 :::443                  :::*                    LISTEN      1935/uhttpd
root@OpenWrt:~# ps w | grep uhttp
 1935 root      3036 S    /usr/sbin/uhttpd -f -h /www -r OpenWrt -x /cgi-bin -u /ubus -t 60 -T 30 -k 20 -A 1 -n 3 -N 100 -R -p 0.0.
 2968 root      1336 R    grep uhttp
root@OpenWrt:~# 

The username is root. Password is the same as your ssh password, unless you've done some unusual/non-standard things with multiple users (you'd know if you had -- this requires lots of additional work).

understood- thats what im using.

You can always change the root password by running the passwd command.

sorry- have changed the root password via ssh and same result. two additional questions:

  • i have a backup for the router. can this be restored via ssh? if so, what is the process?
  • can i perform a clean install of the most recent build via ssh? if so, what is the process?thanks, j

OR:
can i return the installed openwrt firmware to its original config via ssh? and then reset the password to something consistent across luci and ssh?

Try resetting to defaults.

firstboot -y && reboot

psherman:
well, things look worse here. im not sure if this counts as a bricked router, but it isnt acting in a way i can’t understand. heres where it stands:

  • router boots and is ping able when cable connected, also responds with a password request to “ssh root@192.168.1.1”.
  • while cable connected it displays the openwrt login page
  • no passwords now work, it is not connected to any other clients or networks but I can’t log on at all
    Any help would be great.
    Thx, j

Start by making sure that you are absolutely positively connecting to the MT3000 with no other possible network connections.

  • Disable wifi on your computer
  • Connect your computer via Ethernet to the MT3000 lan port.
  • If your computer has any additional Ethernet ports, physically unplug them so that the one and only connection is to the MT3000.
  • Verify that your computer is set to get a DHCP address on the Ethernet port.
  • unplug the cable from the wan port of the MT3000 (or verify that there is nothing connected).

Restart the computer and the router and then try connecting again. If you get errors, please show the details.

Yes. Happy to validate.
All wifi off, single cat5 to router LAN, no other connections
Both devices restarted

At this point I actually CAN log in via SSH and have access to root. I believe your firstboot.. command cleared the password in SSH. a browser opens the login page but username:root & any password, including blank, simply clears the password box and doesn’t complete login.
J

Glad to hear that the ssh login is working.

LuCI should work with root login and no password at all.

Try a different browser. Maybe even use private browsing/incognito mode. Or clear the caches. If that still doesn't work, try a different computer.

Ok. Second browser cleared and we are into LucĂ­. Thanks.
It looks like the base config for openwrt.
So I would expect the next move is to rebuild the config completely from scratch.
I have a backup but am unconvinced the password I have got is correct. Is there any way to restore a backup and force a new password?
J

1 Like

You can try restoring your backup. Worst case you can just reset again and then do a fresh config from scratch.