如何解决远程计算机上的ZSH环境损坏,通过ssh登录后立即崩溃
我无法在没有root用户访问权限的远程计算机上运行oh-my-zsh,因此我尝试了downloading and compiling zsh by following these steps.
我知道我搞砸了最后一步,应该在这里启动zsh "explicitly,or programmatically from your current shell's startup file (put exec $HOME/bin/zsh -l
in the right spot)."
我在〜/ .zshrc的第一行中添加了exec $HOME/bin/zsh -l
并将其作为源,所有内容都冻结了。
现在注销后,我无法删除更改,因为通过ssh登录到远程服务器后,shell崩溃了:
Last login: Thu Aug 20 11:50:42 2020 from ***.***.***.*
~/.zshrc:3: exec format error: ~/bin/zsh
Connection to *my.remote* closed.
或者,终端崩溃后,VScode远程ssh会发回此错误:
The terminal process "/bin/zsh '-l'" terminated with exit code: 126.
对于我的愚蠢错误的任何帮助,我们将不胜感激。谢谢。
解决方法
您需要将exec $HOME/bin/zsh -l
放入登录shell的相应配置文件中。假设是bash
,则将行添加到.bash_profile
。根据评论的建议,使用
ssh -t host vim
开始vim
(或您选择的编辑器)以适当地编辑.zshrc
和.bash_profile
。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。