升級前

telnet 0 22
Trying 0.0.0.0...
Connected to 0.
Escape character is '^]'.
SSH-2.0-OpenSSH_5.4p1 FreeBSD-20100308

步驟:抓source回來解開
./configure && make && make install

修改/etc/rc.conf
sshd_enable="YES"
sshd_program="/usr/local/sbin/sshd"

或是 cd /usr/sbin && mv sshd sshd.bak && ln -s /usr/local/sbin/ssh ssh

測試
telnet 0 22
Trying 0.0.0.0...
Connected to 0.
Escape character is '^]'.
SSH-2.0-OpenSSH_5.8

大功告成

如果擔心遠端升級有風險的話請先把telnet打開

vi /etc/inetd.conf
telnet  stream  tcp     nowait  root    /usr/libexec/telnetd    telnetd

重啟inetd服務
kill -HUP `cat /var/run/inetd.pid`


測試sshd可以正常運作後記得再把telnet關掉

helloworld 發表在 痞客邦 PIXNET 留言(0) 人氣()