centos 配置puTTY rsa自動登入

來源:互聯網
上載者:User

標籤:

vim /etc/ssh/sshd_config, 下面三行去掉注釋符號#RSAAuthentication yesPubkeyAuthentication yesAuthorizedKeysFile .ssh/authorized_keysmkdir -p ~/.sshchmod 700 ~/.ssh

 

產生公開金鑰和私密金鑰

[[email protected] .ssh]# cd ~/.ssh[[email protected] .ssh]# ssh-keygen -t rsaGenerating public/private rsa key pair.Enter file in which to save the key (/root/.ssh/id_rsa):Enter passphrase (empty for no passphrase):Enter same passphrase again:Your identification has been saved in /root/.ssh/id_rsa.Your public key has been saved in /root/.ssh/id_rsa.pub.The key fingerprint is:82:32:47:81:df:8e:6e:0f:ce:ee:a7:fd:f9:6e:52:47 [email protected]The key‘s randomart image is:+--[ RSA 2048]----+| .. || . . || ... || .... E || o oo. S . || +. .. . . || .. . . || ooo. ... || +*+o.o=o |+-----------------+[[email protected] .ssh]#

 

配置

[[email protected] .ssh]# cat id_rsa.pub > authorized_keys[[email protected] .ssh]# chmod 600 authorized_keys[[email protected] .ssh]# lltotal 12-rw-------. 1 root root 408 Jul 11 23:02 authorized_keys-rw-------. 1 root root 1675 Jul 11 22:58 id_rsa-rw-r--r--. 1 root root 408 Jul 11 22:58 id_rsa.pub

 

下載id_rsa到本地,用pyTTYgen轉換為.ppk檔案,配置到putty中,配置登陸使用者名稱root

login as: rootServer refused our key[email protected]192.168.88.133‘s password:

 

登陸失敗。。。需要disable selinux

[[email protected] ~]# getenforceEnforcing[[email protected] ~]# setenforce 0[[email protected] ~]# getenforcePermissive[[email protected] ~]#

 

再次嘗試成功!

Using username "root".Authenticating with public key "imported-openssh-key"Last login: Mon Jul 11 23:27:25 2016 from 192.168.88.1[[email protected] ~]#

 

永久disable selinux
/etc/selinux/config,修改SELINUX=disabled 或者permissive

 

centos 配置puTTY rsa自動登入

相關文章

聯繫我們

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