gpt4 book ai didi

linux - 如何更改OpenWrt的默认shell?

转载 作者:行者123 更新时间:2023-12-03 08:47:35 33 4
gpt4 key购买 nike

OpenWrt的默认shell是ash,但我想将其更改为fish

当我运行chsh -s/usr/bin/fish(fish的绝对路径)时,它返回-ash: chsh: not find.

我将 /etc/passwd 的第一行更改为:

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

至:

root:x:0:0:root:/root:/usr/bin/fish

我无法再次登录(密码错误),系统日志显示:

authpriv.warn dropbear[14288]:用户“root”的 shell 无效,被拒绝


还有其他方法可以更改默认 shell 吗?

(顺便说一句,我使用 a popular fork of OpenWrt 而不是 the official ,但这似乎不是这个问题的原因)

最佳答案

chsh -s /usr/bin/fish是正确的。但是openwrt没有安装chsh命令。你需要跑 opkg install shadow-chsh首先安装chsh命令。然后运行 chsh -s /usr/bin/fish最后,运行 echo $SHELL查看是否更换成功。

请注意,上述操作需要 root 权限才能运行。

抱歉我的英语不好,希望你能理解。

关于linux - 如何更改OpenWrt的默认shell?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60796269/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com