gpt4 book ai didi

linux - debian 终端无法更改为 su

转载 作者:太空宇宙 更新时间:2023-11-04 05:18:52 24 4
gpt4 key购买 nike

我昨天安装了 debian strech。我安装了fish shell。我通过以下方式将默认 shell 更改为 fish

su chsh -s 'which fish'

然后再次输入此命令

su chsh -s `which fish`

现在,在我重新启动电脑后,我在使用“su”时遇到了以下错误

sathish@localhost ~> su
Password:
Cannot execute which fish: No such file or directory

最佳答案

您的意思是在第一个命令中使用常规单引号字符吗?这样做意味着您的 shell 现在实际上是字符串 which Fish 而不是 Fish 命令的路径。这解释了为什么你的第二个命令报告它无法执行“whichfish”。即使没有这个错误,更改 root 帐户的默认 shell 也是一个非常糟糕的主意。你只是自找麻烦。我是作为核心 fish 类开发者这么说的。除非您是一位非常有能力且自信的 CLI 用户,否则您不应该更改 root shell。如果您希望 Fish 作为根 shell,您可以随时在 su 之后执行 exec Fish -l

关于linux - debian 终端无法更改为 su,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44877659/

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