【米尔-瑞萨RZ/G2UL开发板-试用评测】OpenWrt配置串口登录密码
<div class='showpostmsg'><div><strong>开发环境:</strong></div><div>主机:Ubuntu 20.04</div>
<div>开发板:MYD-YG2UL开发板</div>
<div>OpenWrt:OpenWrt 22.03</div>
<h1>1 修改busybox</h1>
<div>make menuconfig选择login选项。</div>
<div>Base system —></div>
<div><*> busybox ……</div>
<div>[*] Customize busybox option</div>
<div>Login/Password Management Utilities —></div>
<div>[*] getty</div>
<div>[*] login (NEW)</div>
<div>EEWORLDIMGTK0</div>
<h1>2 修改配置脚本</h1>
<div><strong>1</strong><strong>.</strong><strong>修改启动脚本</strong><strong>package/base-files/files/usr/libexec</strong></div>
<div>vim login.sh</div>
<div>[ "$(uci -q get system.@system.ttylogin)" = 1 ] || exec /bin/ash --login</div>
<div>改为</div>
<div>[ "$(uci -q get system.@system.ttylogin)" = 1 ] || exec /bin/login</div>
<h1>3 root密码默认设置</h1>
<div>package/base-files/files/etc/shadow</div>
<div></div>
<div>密码password,对应/etc/shadow</div>
<div>root:$1$vPOR/4.z$8W3X.xVaEKu7uiCJb4aPC/:17603:0:99999:7:::</div>
<div>密码root,对应/etc/shadow</div>
<div>root:$1$wYG4jo2z$1YMNH5iEdhMZNgxU15IOO/:19797:0:99999:7:::</div>
<div>设置好,查看/etc/shadow文件,再写到源码。</div>
<div></div>
<h1>4 登录验证</h1>
<div></div>
<div>输入用户名和密码。</div>
</div><script> var loginstr = '<div class="locked">查看本帖全部内容,请<a href="javascript:;" style="color:#e60000" class="loginf">登录</a>或者<a href="https://bbs.eeworld.com.cn/member.php?mod=register_eeworld.php&action=wechat" style="color:#e60000" target="_blank">注册</a></div>';
if(parseInt(discuz_uid)==0){
(function($){
var postHeight = getTextHeight(400);
$(".showpostmsg").html($(".showpostmsg").html());
$(".showpostmsg").after(loginstr);
$(".showpostmsg").css({height:postHeight,overflow:"hidden"});
})(jQuery);
} </script><script type="text/javascript">(function(d,c){var a=d.createElement("script"),m=d.getElementsByTagName("script"),eewurl="//counter.eeworld.com.cn/pv/count/";a.src=eewurl+c;m.parentNode.insertBefore(a,m)})(document,523)</script>
页:
[1]