How to reset luci password from ssh

You actually have to issue mount_root before using passwd, then reboot. The method in this answer alone didn't work for me (18.06.1)

root@(none):~# mount_root
switching to jffs2 overlay
root@(none):/rom/root# passwd
Changing password for root
New password:
Retype password:
passwd: password for root changed by root
root@(none):/rom/root# reboot -f

via https://openwrt.org/docs/guide-user/troubleshooting/root_password_reset


If you'd like to use a non-root user for luci, I did this on a project a few months ago:

https://github.com/sudomesh/luci-app-peopleswifi/blob/master/luasrc/controller/peopleswifi/index.lua

where "admin" was another user in openwrt. It should be said that my understanding is that openwrt is specifically not secure in multi-user environments. While theoretically you can not give that "admin" user a login shell, I'm not sure that I would depend on this solution as a secure alternative to using luci authentication as root.


You can change root password use passwd command via ssh. Normally,the root password is luci password.

\# passwd

Changing password for root

New password: 

Tags:

Openwrt