ubuntu 安裝openssh服務(wù)器的教程詳解
1.安裝openssh 首先得安裝 openssl 和zlib
安裝openssl ---下載openssl-1.0.1j.tar.gz,解壓到/usr/openssl/目錄下進入解壓目錄 執(zhí)行./config -fPIC 如下圖
安裝zlib---下載zlib-1.2.8.tar.gz解壓到/usr/zlib/目錄下
執(zhí)行./configure make 和 make install命令 ok
2.下載openssh.tar.gz包解壓放在/usr/openssh/目錄下 解壓 如圖
執(zhí)行 ./configure 之后部分編譯如下 可以看到 openssh 的配置文件放在了 /usr/local/etc下注意 :一般情況下在/etc/ssh目錄下
OpenSSH has been configured with the following options: User binaries: /usr/local/bin System binaries: /usr/local/sbin Configuration files: /usr/local/etc Askpass program: /usr/local/libexec/ssh-askpass Manual pages: /usr/local/share/man/manX PID file: /var/run Privilege separation chroot path: /var/empty
沒有--with-ssl-dir=/usr/local/ssl可能會報 configure: error: OpenSSL version header not found 執(zhí)行make 和 make install 命令 報錯:Privilege separation user sshd does not exist 解決:在/etc/passwd 中加入: sshd:x:74:74:Privilege-separatedSSH:/var/empty/sshd:/sbin/nologin 再次make install 編譯安裝成功。
openssh 默認(rèn)安裝在/usr/local/sbin/目錄下如圖
開啟ssh服務(wù)
注意要按照絕對路徑開啟ssh服務(wù)否則報錯
查看ssh是否啟動成功
通過putty連接服務(wù)器
打開
打開
連接登陸成功
通過ssh遠(yuǎn)程登陸
報錯 Server responded "Algorithm negotiation failed" 原因 客戶端與服務(wù)端的壓縮方式不一樣
解決方法 修改ssh的配置文件一般在/etc/ssh/sshd_config 但是我這里是在/usr/local/etc/sshd_config下打死
在配置文件中添加:
Ciphers aes128-cbc,aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr,3des-cbc,arcfour128,arcfour256,arcfour,blowfish-cbc,cast128-cbc MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-sha1-96,hmac-md5-96 KexAlgorithms diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group1-sha1,curve25519-sha256@libssh.org
重啟sshd服務(wù)后,即可正常連接,如下圖。
點擊yes輸入密碼
點擊ok
成功
設(shè)置 ssh開機啟動,編輯/etc/rc.local文件
以上所述是小編給大家介紹的ubuntu 安裝openssh服務(wù)器的教程詳解,希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復(fù)大家的。在此也非常感謝大家對腳本之家網(wǎng)站的支持!
相關(guān)文章
Linux系統(tǒng)管理常用命令及參數(shù)說明中文版
這篇文章主要介紹了Linux系統(tǒng)管理常用命令及其參數(shù)的中文版說明,方便了英文不好的同學(xué)學(xué)習(xí)Linux,需要的朋友可以參考下2014-03-03LVS+Keepalived構(gòu)建高可用負(fù)載均衡(測試篇)
這篇文章主要介紹了LVS+Keepalived構(gòu)建高可用負(fù)載均衡的測試方法,需要的朋友可以參考下2013-06-06linux(ubuntu)用戶連續(xù)N次輸入錯誤密碼進行登陸時自動鎖定X分鐘
這篇文章主要介紹了linux(ubuntu)用戶連續(xù)N次輸入錯誤密碼進行登陸時,自動鎖定X分鐘,需要的朋友可以參考下2019-09-09linux系統(tǒng)下一個冷門的RAID卡ioc0及其監(jiān)控mpt-status
這篇文章主要介紹了linux系統(tǒng)下一個冷門的RAID卡ioc0及其監(jiān)控mpt-status,需要的朋友可以參考下2016-05-05Apache Pulsar 微信大流量實時推薦場景下實踐詳解
這篇文章主要為大家介紹了Apache Pulsar 微信大流量實時推薦場景下實踐詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪2022-11-11