SecureCRT配置ssh key訪問linux的步驟

來源:互聯網
上載者:User

第一步,產生公開金鑰/金鑰組

使用SecureCRT的   工具->建立公開金鑰 即可,密碼編譯演算法選擇RSA,因為sshd設定檔中選擇了RSA演算法

這一步會產生兩個檔案,預設是Identity和Identity.pub,其中Identity為密鑰,Identity.pub為公開金鑰。接下來的複雜密碼可以不輸入,不輸入的話登陸時不需要輸入複雜密碼。如果輸入了,登陸的時候會要求你輸入複雜密碼。

第二步,上傳Windows客戶機SecureCRT產生的公開金鑰Identity.pub到使用者目錄下.ssh檔案夾中。注意上傳之前,一定要以ASCII格式上傳。

在使用者宿主目錄下

mkdir .ssh #在需要開啟ssh串連的使用者目錄下建立.ssh目錄

chmod 755 .ssh

ssh-keygen -i -f .ssh/Identity.pub>>.ssh/authorized_keys

chmod 644 .ssh/authorized_keys

第三步

vim /etc/ssh/sshd_config #修改ssh設定檔

(1) Protocol2                                       #僅允許使用SSH2

(2) Port22                                            #使用22連接埠

(3) PermitRootLoginyes                     #允許root登入

(2) PubkeyAuthenticationyes             #啟用公告密鑰配對認證方式

(3) AuthorizedKeysFile.ssh/authorized_keys

(4) RSAAuthenticationyes                   #允許RSA密鑰

(4) PasswordAuthenticationno            #禁止密碼驗證登入,如果啟用的話,OpenSSH的 RSA認證登入就沒有意義了。

第三步,重新載入sshd服務,使用/etc/init.d/ssh restart即可

查看本欄目更多精彩內容:http://www.bianceng.cnhttp://www.bianceng.cn/OS/Linux/

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.