一:環境
SecureCRT版本:SecureCRT_5.1.3
linux版本:
[root@angelT ~]# cat /etc/redhat-release
CentOS release 6.4 (Final)
[root@angelT ~]# uname -r
2.6.32-358.el6.x86_64
linux系統的sshd_config配置文件是默認的,沒有任何的修改。
二:配置SecureCRT客戶端
CRT默認身份驗證第一的是口令驗證,這次我們測試使用它的密鑰身份驗證。
1、選擇工具,創建公鑰
2、選擇RSA加密算法
3、輸入通行短語(登錄時會用到它,就是密碼)
4、我是測試,密鑰長度選擇默認
5、完成,這裏是公鑰和私鑰的地址,是可以更改的,我默認了。(注:這裏高版本會有選擇openssh格式的,直接選擇這個格式,那麼我下面格式轉換的命令可以省略了)
6、這裏的全局我選擇了否
三:分發公鑰到linux和linux端的配置
我這裏用了rz命令,將公鑰上傳到了linux端上。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | [root@angelT ~] # mkdir .ssh [root@angelT ~] # chmod 700 .ssh #創建隱藏目錄.ssh,賦予700權限 [root@angelT ~] # ll -ad .ssh drwx------. 2 root root 4096 4月 15 02:25 . ssh [root@angelT ~] # mv Identity.pub .ssh [root@angelT ~] # cd .ssh [root@angelT . ssh ] # ll 總用量 4 -rw-r--r--. 1 root root 727 4月 14 18:12 Identity.pub [root@angelT . ssh ] # ssh-keygen -i -f Identity.pub >>authorized_keys #我的版本沒有直接能轉換成OpenSSH密鑰格式的選項,所以需要用此命令轉換下 OpenSSH 認的密鑰格式。 [root@angelT . ssh ] # chmod 600 authorized_keys #爲了安全,更改其權限爲600 [root@angelT . ssh ] # ll authorized_keys -rw-------. 1 root root 589 4月 15 02:27 authorized_keys [root@angelT ~] # /etc/init.d/sshd restart #記得,要重啓下sshd服務 停止 sshd: [確定] 正在啓動 sshd: [確定] |
四:SecureCRT客戶端測試連接
選擇公鑰,將公鑰驗證提升到最上面的級別,選擇屬性
選擇使用會話公鑰設置
輸入上面配置的通行短語
OK了,測試成功~~~~進入系統了。。。oye!!!
本文出自 “Chocolee” 博客,請務必保留此出處http://chocolee.blog.51cto.com/8158455/1395618