Reputation: 10394
I have forgotten my luci password, but can get in via ssh. How do I reset the luci password from the console? I see that in /etc/config/luci there is this:
config extern 'flash_keep'
...
option passwd '/etc/passwd'
...
So is it done with the regular passwd command?
Upvotes: 14
Views: 38218
Reputation: 76
You can change root password use passwd
command via ssh. Normally,the root password is luci password.
\# passwd
Changing password for root
New password:
Upvotes: 6
Reputation: 2952
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
Upvotes: 2
Reputation: 3499
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.
Upvotes: 1