xshell 使用密鑰驗證遠程登入linux

來源:互聯網
上載者:User

標籤:伺服器   linux   遠程登入   

使用xshell做密鑰驗證遠程登入linux:

我這裡用的工具:xshell 5 及 centos 6.5



首先在工具列選擇建立使用者密鑰產生嚮導,進行金鑰組產生操作

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M02/5B/1B/wKiom1T--x6DkT2LAABv6XEGzwY781.jpg" title="1.jpg" alt="wKiom1T--x6DkT2LAABv6XEGzwY781.jpg" />

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M00/5B/1B/wKiom1T--x7xcLIbAADdUddDcOs584.jpg" title="2.jpg" alt="wKiom1T--x7xcLIbAADdUddDcOs584.jpg" />

  下一步

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M01/5B/15/wKioL1T-_DyzMaSAAAFeVFVYZoc619.jpg" title="3.jpg" alt="wKioL1T-_DyzMaSAAAFeVFVYZoc619.jpg" />

產生公開金鑰對,下一步

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M01/5B/1B/wKiom1T--x-Tj5gGAAGFuOWqxWA826.jpg" title="4.jpg" alt="wKiom1T--x-Tj5gGAAGFuOWqxWA826.jpg" />


這裡也可以直接點“完成”,這裡選“下一步”(原因看下一張圖)

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M02/5B/15/wKioL1T-_DzROAFnAAExxNWXUKw847.jpg" title="5.jpg" alt="wKioL1T-_DzROAFnAAExxNWXUKw847.jpg" />


選中公開金鑰複製,保留,或者儲存為檔案,後面要用到

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M02/5B/1B/wKiom1T--x_Do4YbAAIzTMn2Tsc501.jpg" title="6.jpg" alt="wKiom1T--x_Do4YbAAIzTMn2Tsc501.jpg" />


在伺服器端,儲存公開金鑰到伺服器,修改相關檔案

[[email protected]ost ~]# mkdir .ssh

[[email protected] ~]# vim .ssh/authorized_keys 將複製的公開金鑰粘貼到此檔案

修改許可權

[[email protected] ~]# chmod 600 .ssh/authorized_keys

[[email protected] ~]# chmod 700 .ssh

關閉selinux

[[email protected] ~]# setenforce 0  臨時修改

[[email protected] ~]# vim /etc/selinux/config 

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M01/5B/1B/wKiom1T_AoODgsR4AAFCg4sLb9s045.jpg" title="9.jpg" alt="wKiom1T_AoODgsR4AAFCg4sLb9s045.jpg" />


[[email protected] ~]# iptables -F  清空iptables

[[email protected] ~]# service iptables save

設定啟用密鑰登入

[[email protected] ~]# vim /etc/ssh/sshd_config

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M02/5B/1B/wKiom1T_BOPhZd4_AALjTu7fqH4699.jpg" title="10.jpg" alt="wKiom1T_BOPhZd4_AALjTu7fqH4699.jpg" />


[[email protected] ~]# service sshd restart  重啟sshd


至此,設定xshell使用密鑰登入

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M00/5B/1B/wKiom1T--yLgynUdAAHEvsECdqI942.jpg" title="8.jpg" alt="wKiom1T--yLgynUdAAHEvsECdqI942.jpg" />


xshell 使用密鑰驗證遠程登入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.