Generated with sparks and insights from 4 sources

img2

img3

img4

img5

img6

img7

Introduction

  • LuCI, the web interface for OpenWrt, is primarily designed to be accessed by the root user.

  • Logging in as a non-root user in LuCI requires significant modifications and is not straightforward.

  • To hide the root user on the LuCI login page, you can modify the [dispatcher.uc](prompt://ask_markdown?question=dispatcher.uc) file and change the default user.

  • Even if a non-root user is allowed to log in, they typically gain full root rights through the UI.

  • There are no built-in options in LuCI to add or define a non-root user with limited access.

Default LuCI Login [1]

  • Default Username: The default username for LuCI is 'root'.

  • Default Password: The password is the same as the one used to access the web Admin Panel.

  • Access URL: Navigate to [192.168.8.1/cgi-bin/luci](prompt://ask_markdown?question=192.168.8.1/cgi-bin/luci) to reach the LuCI login page.

Modifying LuCI for Non-Root Access [2]

  • File Modification: Changes need to be made in files like dispatcher.uc and [sysauth.js](prompt://ask_markdown?question=sysauth.js).

  • JavaScript Rendering: Much of LuCI has moved to client-side JavaScript rendering.

  • Ucode Conversion: Server-side components are being converted to ucode.

  • Example Code: Modify dispatcher.uc to change duser: 'root' to duser: ''.

Challenges and Limitations [3]

  • Full Root Rights: Non-root users gain full root rights through the UI.

  • No Built-in Support: LuCI does not have built-in support for non-root user access.

  • white screen issue: Logging in with a non-root user often results in a blank screen.

  • Serious Hacking Required: Significant modifications are needed to support non-root users.

Steps to Hide Root User [2]

  • Modify dispatcher.uc: Change duser: 'root' to duser: ''.

  • Update sysauth.js: Change type='password' to type='text'.

  • Add to Startup: Use sed commands to automate these changes on boot.

  • Check for Changes: Ensure changes are needed before applying them to avoid unnecessary writes.

User Experiences and Issues [4]

  • browser cache: Issues logging in can sometimes be resolved by clearing the browser cache.

  • password length bug: Some routers have a bug where only the first 32 characters of a password are saved.

  • Blank Screen: Non-root users often encounter a blank screen upon login.

  • community solutions: Various community members have shared scripts and patches to address these issues.

Related Videos

<br><br>

<div class="-md-ext-youtube-widget"> { "title": "OpenWRT - AP Client /Wireless Client mode with LuCI & ...", "link": "https://www.youtube.com/watch?v=VX2PYzGMntc", "channel": { "name": ""}, "published_date": "May 2, 2021", "length": "" }</div>

<div class="-md-ext-youtube-widget"> { "title": "OpenWrt Setup Guide", "link": "https://www.youtube.com/watch?v=uhJF0XmVhME", "channel": { "name": ""}, "published_date": "Jul 11, 2020", "length": "" }</div>