二、配置SSH 密匙遠(yuǎn)程登陸
加密的三種方式:
1、對稱加密,加密與解密的密匙相同:AES,DES,3DES;
2、非對稱加密,公鑰加密,私鑰解密:RSA,DH,DSA,;
3、哈希算法,信息完整性校驗(yàn):MD5,SHA;
配置SSH RSA密匙對:
在本地客戶端上使用ssh-keygen命令生成密匙對,加入-N選項(xiàng),設(shè)定私密加密密匙為空,這樣ssh遠(yuǎn)程客戶端的時(shí)候就不需要再輸入私鑰的密碼:
[redhat@linuxidc ~]$ ssh-keygen -N ""
Generating public/private rsa key pair.
Enter file in which to save the key (/home/redhat/.ssh/id_rsa):
Created directory '/home/redhat/.ssh'.
Your identification has been saved in /home/redhat/.ssh/id_rsa.
Your public key has been saved in /home/redhat/.ssh/id_rsa.pub.
在家目錄的.ssh目錄下面,生成公鑰和私鑰對文件:
[redhat@linuxidc .ssh]$ ls
id_rsa id_rsa.pub
使用ssh-copy-id命令將本地的公鑰發(fā)送到遠(yuǎn)程客戶端的家目錄:
[redhat@linuxidc .ssh]$ ssh-copy-id -i id_rsa.pub root@localhost
[root@linuxidc .ssh]# ls -al
-rw-------. 1 root root 399 Jan 6 15:37 authorized_keys
復(fù)制公鑰完成后,本地客戶端ssh遠(yuǎn)程客戶端不需要密碼即可直接登錄:
[c:\~]$ ssh redhat@IP
在Windows 使用RSA密匙對登錄RHEL7:
首先,使用Xshell的用戶密匙管理功能生成本地的RSA公鑰:
將生成的公鑰導(dǎo)出到本地電腦保存,并將該公鑰文件上傳到遠(yuǎn)端服務(wù)器:
將公鑰文件內(nèi)容追加到.ssh目錄下面的Authorized_keys文件:
[root@linuxidc .ssh]# cat id_rsa_1024.pub >>authorized_keys
2015職稱計(jì)算機(jī)考試書PowerPoint2007中 .. 定價(jià):¥45 優(yōu)惠價(jià):¥42 更多書籍 | |
2015年全國職稱計(jì)算機(jī)考試教材(2007模 .. 定價(jià):¥225 優(yōu)惠價(jià):¥213 更多書籍 |