自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

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

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

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

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

然后在opensuse上要使用密鑰方式登陸的的用戶(hù)目錄下建立.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

為安全起見(jiàn),修改該文件的訪問(wèn)權(quán)限,保證除屬主外沒(méi)人能修改

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就沒(méi)什么意思了,根本沒(méi)把安全提高。 修改ssh_config配置文件

lxuser@suse10:/etc/ssh> vi ssh_config

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

PasswordAuthentication no

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

suse10:/etc/ssh # vi ssh_config

suse10:/etc/ssh # rcsshd restart

Shutting down SSH daemon done

Starting SSH daemon done

責(zé)任編輯:Oo小孩兒 來(lái)源: linuxeden.com
相關(guān)推薦

2020-10-13 06:59:12

CA簽名密鑰SSH

2011-09-09 13:28:01

Ubuntussh

2009-08-14 09:40:55

MyEclipse整合

2018-09-20 09:12:16

2010-04-21 17:20:03

Unix遠(yuǎn)程

2021-06-02 14:45:52

遠(yuǎn)程服務(wù)器Python

2011-02-24 10:10:12

HillstoneRSA 2011

2013-04-09 15:06:23

2020-03-01 17:04:17

Python數(shù)據(jù)運(yùn)維

2015-05-28 15:32:14

Linuxssh

2012-05-08 11:14:27

LinuxOpenSSHSSH

2015-10-21 11:03:21

ssh登錄Linux

2010-05-28 15:08:09

MySQL遠(yuǎn)程登陸

2010-06-13 14:49:02

MySQL創(chuàng)建遠(yuǎn)程登陸

2010-05-12 11:43:31

MYSQL遠(yuǎn)程登陸用戶(hù)

2018-03-16 10:57:06

Linux安全密鑰

2013-06-09 14:33:34

2018-02-09 09:00:00

2012-10-23 09:54:17

2009-08-16 20:24:59

linux命令行登陸linux命令行linux命令
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)