【发布时间】:2017-09-09 10:43:36
【问题描述】:
我过去曾在 mac 上使用终端来通过 SSH 访问我的网站。但是,每次我尝试打开终端时,我都会自动登录。而且我无法注销/退出以使用终端。它总是“在外壳内”。
当我尝试“退出”或“注销”或“ctrl + d”时,它会注销并得到“[进程完成]”。但是,我无法使用终端,按任何键都没有任何反应。
所以我退出终端并重新启动它,然后我回到第一格,登录到 SSH。我想使用终端应用程序。
【问题讨论】:
我过去曾在 mac 上使用终端来通过 SSH 访问我的网站。但是,每次我尝试打开终端时,我都会自动登录。而且我无法注销/退出以使用终端。它总是“在外壳内”。
当我尝试“退出”或“注销”或“ctrl + d”时,它会注销并得到“[进程完成]”。但是,我无法使用终端,按任何键都没有任何反应。
所以我退出终端并重新启动它,然后我回到第一格,登录到 SSH。我想使用终端应用程序。
【问题讨论】:
我之前从未测试过,但通过快速搜索,我找到了两篇文章,first article 和 second article。
第一篇文章提到了别名(这是不使用远程服务器密码的 ssh 登录)。您可以尝试检查您的 .bashrc 文件中是否创建了别名,如果有,则将其删除。
第二篇文章提到了改变你的终端行为,这很可能是你的情况。文章提到您可以检查您的默认 shell 路径是什么。
检查您的 shell 路径的步骤:
- Go to terminal and open preferences
- Under General tab, you will see 'Shells open with'
- If it is under default then you might want to check '/usr/bin/login' and '/bin/bash', if there is anything that run the above alias and remove it if there is.
- If it is under Command(complete path), then you might want to check the path, if there is anything that run the above alias and remove it if there is.
我再说一遍,我没有测试过这个,因为我没有这个问题,但我希望这能帮助你解决你的问题。祝你有美好的一天。
【讨论】:
通过 登录服务器时,您可以通过做得到tty PID。
ps 效果
然后就用kill,like;
kill -9 PID
这将终止您和服务器的连接。
【讨论】: