溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

CentOS下怎么使用OpenSSL編譯安裝OpenSSH

發(fā)布時間:2022-02-17 09:34:58 來源:億速云 閱讀:149 作者:iii 欄目:開發(fā)技術(shù)

這篇“CentOS下怎么使用OpenSSL編譯安裝OpenSSH”文章的知識點大部分人都不太理解,所以小編給大家總結(jié)了以下內(nèi)容,內(nèi)容詳細(xì),步驟清晰,具有一定的借鑒價值,希望大家閱讀完這篇文章能有所收獲,下面我們一起來看看這篇“CentOS下怎么使用OpenSSL編譯安裝OpenSSH”文章吧。

CentOS下怎么使用OpenSSL編譯安裝OpenSSH

檢測已安裝的包

# rpm -qa | grep openssh openssh# rpm -qa | grep openssh openssl

卸載用rpm -e 如果出現(xiàn)依賴包導(dǎo)致無法卸載,在最后面加上–nodeps即可,例:

# rpm -e openssl --nodeps

具體安裝過程如下:

下載最新軟件包源碼

http://ftp5.usa.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-7.3p1.tar.gz
http://www.openssl.org/source/openssl-1.0.2j.tar.gz
http://www.openssl.org/source/openssl-fips-2.0.13.tar.gz
使用YUM安裝必要的軟件開發(fā)包
# yum install -y zlib-devel pam-devel tcp_wrappers-devel

安裝openssl-fips

具體說明見 http://www.openssl.org/docs/fips ;

# tar zxpf openssl-fips-2.0.5.tar.gz# cd openssl-fips# ./config# make && make install

安裝OpenSSL

# tar zxpf openssl-1.0.1h.tar.gz# cd openssl-1.0.1h# ./config fips --shared# make && make install
將新編譯的openssl library 加入系統(tǒng)動態(tài)庫鏈接中
# echo "/usr/local/ssl/lib" >> /etc/ld.so.conf# ldconfig

安裝OpenSSH

# tar zxpf openssh-6.6p1.tar.gz# cd openssh-6.6p1# ./configure \ --prefix=/usr \
 --sysconfdir=/etc/ssh \
 --with-md5-passwords \
 --with-pam \
 --with-tcp-wrappers \
 --with-ssl-dir=/usr/local/ssl# make && make install# ssh -V

修改相關(guān)配置

# cp -p contrib/redhat/sshd.init /etc/init.d/sshd    (此處的contrib路徑為解壓后的OpenSSH包路徑)# chmod u+x /etc/init.d/sshd                             (加執(zhí)行權(quán)限)# chkconfig --add sshd                                      (增加sshd服務(wù))# chkconfig sshd on                                          (把sshd加入啟動項)# yum install openssh                                          (安裝OpenSSH客戶端)# vim /etc/ssh/sshd_configPermitRootLogin yes                #允許root賬戶登錄,單root賬戶必須加上,其他的參數(shù)請自行修改
測試登錄
# /etc/init.d/sshd startssh-keygen: illegal option -- A

Usage: ssh-keygen [options]

Options:

-a trials   Number of trials for screening DH-GEX moduli.

-B          Show bubblebabble digest of key file.

-b bits     Number of bits in the key to create.

-C comment  Provide new comment.

-c          Change comment in private and public key files.

-e          Convert OpenSSH to IETF SECSH key file.

-F hostname Find hostname in known hosts file.

-f filename Filename of the key file.

-G file     Generate candidates for DH-GEX moduli.

-g          Use generic DNS resource record format.

-H          Hash names in known_hosts file.

-i          Convert IETF SECSH to OpenSSH key file.

-l          Show fingerprint of key file.

-M memory   Amount of memory (MB) to use for generating DH-GEX moduli.

-N phrase   Provide new passphrase.

-P phrase   Provide old passphrase.

-p          Change passphrase of private key file.

-q          Quiet.

-R hostname Remove host from known_hosts file.

-r hostname Print DNS resource record.

-S start    Start point (hex) for generating DH-GEX moduli.

-T file     Screen candidates for DH-GEX moduli.

-t type     Specify type of key to create.

-v          Verbose.

-W gen      Generator to use for generating DH-GEX moduli.

-y          Read private key file and print public key.

Starting sshd:                                             [  OK  ]

sshd文件的ssh-keygen參數(shù)有問題,暫時不知道怎么解決,但是不影響使用。

以上就是關(guān)于“CentOS下怎么使用OpenSSL編譯安裝OpenSSH”這篇文章的內(nèi)容,相信大家都有了一定的了解,希望小編分享的內(nèi)容對大家有幫助,若想了解更多相關(guān)的知識內(nèi)容,請關(guān)注億速云行業(yè)資訊頻道。

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI