CentOS 6.5 升級 openssh

來源:互聯網
上載者:User

標籤:style   blog   http   os   ar   for   檔案   sp   2014   

    最近有空複習了一下Linux,在虛擬機器上安裝了個CentOS6.5,順便升級一下系統內建的openssh,任何系統操作都有風險,正式環境請做好備份工作。廢話少說,直接貼代碼。

    1、準備工作,相應的包自己到官方下載,另外需要下載依賴包openssl以及zlib包。

    openssh:http://www.openssh.com/portable.html#http

    openssl:http://www.openssl.org/source/

    zlib:http://zlib.net/zlib-1.2.8.tar.gz

    

    2、卸載系統內建的openssh,卸載之前先停止sshd服務,再用rpm刪除,同時清除系統/etc/ssh目錄

[[email protected] tmp]# service sshd stopStopping sshd:                                             [  OK  ] [[email protected] tmp]# rpm -qa opensshopenssh-5.3p1-94.el6.x86_64[[email protected] tmp]# rpm -e openssh-server[[email protected] tmp]# rpm -e openssh-clients[[email protected] tmp]# rpm -e openssh-askpass[[email protected] tmp]# rpm -e openssh[[email protected] tmp]# rm -rf /etc/ssh

    3、安裝zlib

[[email protected] tmp]# tar -xvf zlib-1.2.8.tar.gz [[email protected] tmp]# cd zlib-1.2.8[[email protected] zlib-1.2.8]# ./configure --prefix=/usr/local/zlib && make && make install

    4、安裝openssl

[[email protected] tmp]# tar -xvf openssl-1.0.1i.tar.gz [[email protected] tmp]# cd openssl-1.0.1i[[email protected] openssl-1.0.1i]# ./config --prefix=/usr/local/openssl && make && make install

    5、安裝openssh

[[email protected] tmp]# tar -xvf openssh-6.6p1.tar.gz[[email protected] tmp]# cd openssh-6.6p1[[email protected] openssh-6.6p1]# ./configure --prefix=/usr/local/openssh --sysconfdir=/etc/ssh --with-ssl-dir=/usr/local/openssl --with-zlib=/usr/local/zlib --with-md5-passwords --without-hardening && make && make install

    6、修改設定檔

[[email protected] openssh-6.6p1]# cp contrib/redhat/sshd.init /etc/init.d/sshd[[email protected] openssh-6.6p1]# chmod +x /etc/init.d/sshd [[email protected] openssh-6.6p1]# vi /etc/init.d/sshd
修改對應指令的安裝目錄=============================25行    SSHD=/usr/sbin/sshd 為 SSHD=/usr/local/openssh/sbin/sshd41行    /usr/bin/ssh-keygen -A 為 /usr/local/openssh/bin/ssh-keygen -A=============================儲存退出

    7、加入到系統服務

[[email protected] openssh-6.6p1]# chkconfig --add sshd[[email protected] openssh-6.6p1]# service sshd start

    8、編譯中遇到的錯誤,參考博文http://zjwsk.blog.163.com/blog/static/598306132014313112351/,感謝博主的分享

configure: error: *** Can‘t find recent OpenSSL libcrypto (see config.log for details) ***

CentOS 6.5 升級 openssh

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.