基于OpenWrt V23.05版本,修改UI登录用户

1.修改/etc/passwd文件

root@ZhouWu:/etc# cat passwd

root:x:0:0:root:/root:/bin/ash

admin:x:0:0:root:/root:/bin/ash

daemon:*:1:1:daemon:/var:/bin/false

2.修改/etc/shadow文件

root@ZhouWu:/etc# cat  shadow

root:$1$GugEHiem$ZZ4CaPfJ5UkGq0Kpc.2vf/:19607:0:99999:7:::

admin:$1$GugEHiem$ZZ4CaPfJ5UkGq0Kpc.2vf/:19607:0:99999:7:::

daemon:*:0:0:99999:7:::

3.修改/etc/config/rpcd

config rpcd

        option socket /var/run/ubus/ubus.sock

        option timeout 30

config login

        option username 'admin'

        option password '$p$admin'

        list read '*'

        list write '*'

4.修改/usr/share/ucode/luci/template/themes/bootstrap/sysauth.ut文件

#
 Copyright 2022 Jo-Philipp Wich <jo@mein.io>
 Licensed to the public under the Apache License 2.0.
-#}

{% include('header', { blank_page: true }) %}

<section hidden>
        <form method="post" class="cbi-map">
                <div class="cbi-section">
                        <div class="cbi-section-node">
                                <div class="cbi-value">
                                        <label class="cbi-value-title" for="luci_username">{{ _('Username') }}</label>
                                        <div class="cbi-value-field">
                                                <input name="luci_username" id="luci_username" type="text" autocomplete="username" value="admin">
                                        </div>
                                </div>
                                <div class="cbi-value">
                                        <label class="cbi-value-title" for="luci_password">{{ _('Password') }}</label>
                                        <div class="cbi-value-field">
                                                <input name="luci_password" id="luci_password" type="password" autocomplete="current-password">
                                        </div>
                                </div>
                        </div>
                </div>
        </form>
5.测试如下:

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值