linux 服务器卸载了 zsh 后不能连接了

2016-04-12 11:59:30 +08:00
 ifconfig

1.通过 yum 安装的 zsh 2.执行 yum remove zsh 然后断开终端,就再也连不上了,提示密码错误 作死啊,这到底什么回事?自己的服务器都没事,死翘翘了

2297 次点击
所在节点    问与答
16 条回复
lxy42
2016-04-12 12:02:46 +08:00
login shell 的问题?
9hills
2016-04-12 12:03:32 +08:00
你配置了 zsh 为 login shell ,然后。。。
lxy42
2016-04-12 12:04:01 +08:00
试试用别的用户名登录
ifconfig
2016-04-12 12:04:39 +08:00
@lxy42 @9hills 我也觉得应该是这个问题,咋整?
lxy42
2016-04-12 12:06:09 +08:00
@ifconfig 试试登录 root 账户,如果你没有设置 root 账户的 login shell 为 zsh 的话。
ifconfig
2016-04-12 12:07:13 +08:00
@lxy42 默认就是登陆 root 的,现在就是 root 可能设了 login shell 为 zsh 。。。。。
lxy42
2016-04-12 12:08:18 +08:00
@ifconfig 那别的用户呢?
gamexg
2016-04-12 12:10:04 +08:00
尝试换个其他用户。
这个用户感觉是挂了, shell 应该不能远端更改,否则 nologin shell 就没用了。

希望 linux 大牛详细解答下。
ifconfig
2016-04-12 12:17:46 +08:00
@gamexg @lxy42 同事有一台电脑在我误操作前就用 root 登了进去,现在可以用它电脑看,现在应该是怎样的步骤?
lxy42
2016-04-12 12:19:30 +08:00
@ifconfig 😰手抖老是点到感谢, chsh 命令改变 shell
gamexg
2016-04-12 12:20:18 +08:00
vi /etc/passwd
ayang23
2016-04-12 12:20:19 +08:00
@ifconfig 修改 /etc/passwd 把 shell 改回 /bin/bash, 还有救
jasontse
2016-04-12 12:21:35 +08:00
chsh
gxustudent
2016-04-12 12:29:23 +08:00
细思极恐,这种情况肯定是有个人先把 bash 改成了 zsh ,你却把 zsh 删了,你和他什么仇什么怨?
ferock
2016-04-12 12:32:24 +08:00
不要修改 root 的 bash
不要修改 root 的 bash
不要修改 root 的 bash

重要的事情说三遍。。。
ifconfig
2016-04-12 12:32:25 +08:00
@gamexg @ayang23 @gxustudent @lxy42 @9hills

谢谢各位提醒,由于对 Linux 不熟悉,导致这次错误,会深刻反省。
解决办法:利用同事的电脑顺利修改 /etc/passwd , 改成 /bin/bash 。
给后人提醒,结贴~~~

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/270407

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX