Ssh
SSH 連接因 shell 無法載入而關閉
我有使用 OpenSSH 執行的 FreeBSd。我設置了所有內容,並且通過 SSH 的連接執行良好。然後我決定擺脫一些未使用的埠,我顯然解除安裝了一個 zsh 使用的埠。
當我登錄時,我得到以下資訊:
~ # ssh cristian@192.168.1.56 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, e.g. 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 questions@FreeBSD.org 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 cristian@192.168.1.56 /usr/local/bin/sh << EOF chsh -s /usr/local/bin/bash EOF Password: Shared object "libiconv.so.3" not found, required by "zsh"%
任何想法如何在沒有鍵盤和顯示器的情況下解決它?
我曾經犯過同樣的錯誤。我懷疑您是否能夠獲得遠端更改 shell 所需的 root 訪問權限。另一個不太可能的選擇是破解你自己的盒子並獲得 root 權限。
我必須通過鍵盤和監視器在本地連接並更改為預設外殼。永遠不要讓 root 使用使用者態 shell。始終讓 root 使用系統自帶的預設 shell。如果您需要或想要使用不同的 shell,請在登錄後手動啟動它。這就是我現在所做的。
make delete-old-libs
請記住,/usr/src
除非您絕對知道您將不再需要這些庫,否則不要這樣做:-D