小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

遠(yuǎn)程攻略:SecureCRT使用RSA密鑰登陸SSH

 浸心閣 2015-08-03

一直在SecureCRT上使用密碼和鍵盤交互方式登陸ssh,一直沒試成功,今天無意在一篇文章里受了點(diǎn)啟發(fā),順便就在前些天裝的虛擬機(jī)上試成了。客戶端用的SecureCRT5.5.1,服務(wù)端為openSUSE10.3上默認(rèn)安裝的OpenSSH_4.6p1。

首先配置SecureCRT上的RSA密鑰,打開SecureCRT→Quick Connect→Authentiation→PublicKey→Properties→Create Identity File,Key選擇RSA;Passphrase可以不同于密碼,任意的字符串即可;Key length in為加密長度,可為512到2048位,要是在linux上可配置4096;下一步為生成過程,需要不停在進(jìn)度條附近晃動(dòng)鼠標(biāo),選擇在x:\%USERPROFILE%Application DataVanDyke下生成兩個(gè)文件,并且格式為Openssh Key format,要是選默認(rèn)的Standard Public Key and VanDyke Private Key可能還需要格式轉(zhuǎn)換或有兼容問題,公鑰Identity.pub和私鑰Identity。

然后在opensuse上要使用密鑰方式登陸的的用戶目錄下建立.ssh目錄,這里我偷懶直接運(yùn)行ssh-keygen工具創(chuàng)建本機(jī)密鑰會(huì)自動(dòng)創(chuàng)建.ssh目錄并設(shè)置合適目錄權(quán)限。

lxuser@suse10:/etc/ssh> ssh-keygen

Generating public/private rsa key pair.

Enter file in which to save the key (/home/lxuser/.ssh/id_rsa):

Created directory /home/lxuser/.ssh.

Enter passphrase (empty for no passphrase):

Enter same passphrase again:

Your identification has been saved in /home/lxuser/.ssh/id_rsa.

Your public key has been saved in /home/lxuser/.ssh/id_rsa.pub.

The key fingerprint is:

d8:07:b9:d6:f9:4d:0c:e3:c7:8c:82:f4:a3:20:71:f4 lxuser@suse10

利用sftp或其他方式將公鑰Identity.pub上傳到剛建立好的.ssh目錄里,修改文件名為authorized_keys2,這是因?yàn)槭褂玫氖莂uthorized_keys這個(gè)文件,而用的ssh版本為2(openSUSE默認(rèn)也僅使用Protocol 2).

lxuser@suse10:~/.ssh> mv Identity.pub authorized_keys2

安全起見,修改該文件的訪問權(quán)限,保證除屬主外沒人能修改

lxuser@suse10:~/.ssh> chmod 600 authorized_keys2

>

總計(jì) 16

-rw------- 1 lxuser users 234 11-02 20:20 authorized_keys2

-rw------- 1 lxuser users 1743 11-02 19:23 id_rsa

-rw-r--r-- 1 lxuser users 395 11-02 19:23 id_rsa.pub

再回到SecureCRT,在Quick Connect→Authentiation處僅勾選PublicKey,并設(shè)置屬性Properties,指定Use identity or certificate file為私鑰Identity,確定后連接,正常的話會(huì)提示輸入前面設(shè)置的Passphrase,若成功則直接登陸了。

Last login: Fri Nov 2 20:38:21 2007 from printer.mshome.net

Have a lot of fun...

至此任務(wù)算基本成功了。既然已經(jīng)成功使用了ssh的RSA功能,那么索性讓openssh只支持RSA驗(yàn)證,否則既支持普通密碼又支持RSA就沒什么意思了,根本沒把安全提高。 修改ssh_config配置文件

lxuser@suse10:/etc/ssh> vi ssh_config

取消密碼登陸驗(yàn)證

PasswordAuthentication no

然后重啟sshd服務(wù)再次嘗試用鍵盤和密碼交互登陸,就提示不成功了,而使用PublicKey是方便了許多,免去了反復(fù)輸入密碼的麻煩,安全較高(不過要是客戶端宿主機(jī)本身不安全,那后果也就......)。

suse10:/etc/ssh # vi ssh_config

suse10:/etc/ssh # rcsshd restart

Shutting down SSH daemon done

Starting SSH daemon done

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多