我有FreeBSd与OpenSSH运行。 我build立了一切,通过SSH连接完美。 然后我决定摆脱一些没有使用的端口,我明显卸载了一个由zsh使用的端口。
当我login时,我得到以下内容:
~ # ssh [email protected] Password: Last login: Wed Nov 7 21:56:26 2012 from 192.168.1.52 FreeBSD 9.0-RELEASE (GENERIC) #0: Tue Jan 3 07:15:25 UTC 2012 Welcome to FreeBSD! Before seeking technical support, please use the following resources: o Security advisories and updated errata information for all releases are at http://www.FreeBSD.org/releases/ - always consult the ERRATA section for your release first as it's updated frequently. o The Handbook and FAQ documents are at http://www.FreeBSD.org/ and, along with the mailing lists, can be searched by going to http://www.FreeBSD.org/search/. If the doc package has been installed (or fetched via pkg_add -r lang-freebsd-doc, where lang is the 2-letter language code, eg en), they are also available formatted in /usr/local/share/doc/freebsd. If you still have a question or problem, please take the output of `uname -a', along with any relevant error messages, and email it as a question to the [email protected] mailing list. If you are unfamiliar with FreeBSD's directory layout, please refer to the hier(7) manual page. If you are not familiar with manual pages, type `man man'. Edit /etc/motd to change this login announcement. Shared object "libiconv.so.3" not found, required by "zsh"Connection to 192.168.1.56 closed.
问题是我没有显示器,也没有键盘(现在)很快解决问题…
我试图强制加载一个不同的shell> 强制SSH使用特定的shell
不行,因为我得到:
~ # ssh [email protected] /usr/local/bin/sh << EOF chsh -s /usr/local/bin/bash EOF Password: Shared object "libiconv.so.3" not found, required by "zsh"%
任何想法如何解决它没有键盘和显示器?
我做了同样的确切的错误一次。 我怀疑你将能够获得远程更改您的shell所需的根访问权限。 另一个不太可能的select是破解你自己的盒子并获得root权限。
我不得不通过键盘和显示器本地连接,并更改为默认的shell。 永远不要让root用户使用一个用户空间。 始终让root用户使用系统附带的默认shell。 如果您需要或想要使用不同的shell,请在login后手动启动它。 这就是我现在所做的。
请记住,不要在/usr/src make delete-old-libs ,除非您完全知道您不再需要这些libs:-D
如果sftp工作,我会尝试上传一个~/.ssh/rc文件和我需要运行的命令(或许是echo password | chsh -s /usr/local/bin/bash ?),希望ssh作为它的手册页面状态,在启动用户的shell之前执行这些命令。
方法1
尝试以下
ssh username @ hostname“/ bin / sh -i”
这将让你用sh而不是bashlogin,如果成功的话。
方法2
SSH与另一个用户的框,然后苏/ sudo重新获得根访问。
bash和zsh都依赖于libiconv ,所以既不会为你工作,因为你删除了它。 你可以像Johnbuild议的那样做,并且明确地告诉ssh运行sh或csh ,它们都在基本系统中,因此它们应该能够正常工作,因为它们在端口上没有任何外部依赖。
ssh me@there "/bin/sh -i"
您现在有一个shell会话,您可以在其中再次安装libiconv 。 为了将来的参考,值得使用像ports-mgmt/pkg_cutleaves这样的东西去除你不再需要的端口 – 这让你更难以像这样在脚下自我射击!