如何更改OpenWrt的默认外壳?

OpenWrt的默认外壳为ash,但我想将其更改为fish

当我运行chsh -s /usr/bin/fishfish的绝对路径)时,它返回了-ash: chsh: not found

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

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

收件人:

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

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

authpriv.warn dropbear[14288]: User 'root' has invalid shell,rejected


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

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

condorc 回答:如何更改OpenWrt的默认外壳?

有两种方法可以解决此问题。您可以:

/usr/bin/fish添加到/etc/shells

此解决方案由上面的@glenn-jackman在评论中提供。

或者:

dropbear代替openssh-server

我想出了另一种方法:如果您恰好安装了openssh-server,我建议您安装use it as default following this tutorial


并记住将/ etc / passwd的第一行更改为:

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

本文链接:https://www.f2er.com/2604140.html

大家都在问