我在我的~/.bashrc (这是一个Linode盒子)的末尾添加了下面一行,并退出了我的ssh会话。
source ~/.profile
现在,当我login时,shell没有响应。 我从来没有得到提示,进入命令什么都不做。
如果我按Ctrl-c,然后closuresSSH连接。 Ctrl-Z也不做任何事情。 我无法访问~/.profile来尝试查看问题是什么。
我怎样才能得到回应?
为了让你的shell回来,只需使用这个过程。
希望你记得早些时候在那里的.bashrc的内容。 它应该是这样的:
# .bashrc # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi
把它们放在一个名字为.bashrc的文件中,从你可以访问你的Linode机器的机器上。
现在使用这个命令:
# scp .bashrc server:.
这将replace您的修改后的.bashrc这个默认的,你应该能够得到你的shell。
如果您遇到任何问题,请告诉我。
通常你可以告诉bash忽略这些rc文件:
ssh -t your-host bash --noprofile --norc
login后,您可以查看和更新有问题的rc文件。
人们已经问过你如何解决这个问题。 但是为什么这发生在你身上呢?
在Debian / Ubuntu中,在~/.profile有这样一段代码:
# if running bash if [ -n "$BASH_VERSION" ]; then # include .bashrc if it exists if [ -f "$HOME/.bashrc" ]; then . "$HOME/.bashrc" fi fi
所以,默认情况下, ~/.profile包含~/.bashrc 。 如果你告诉~/.bashrc包含~/.profile ,你正在创build一个无限循环。