转载:使用SecureCRT + RSA密钥 + SSH 登录 Linux

原理: 通过SecureCRT生成RSA密钥对,将公钥上传到Linux 的sshd 服务器,配置sshd使用RSA密钥登录
 
一 SecureCRT配置,生产密钥对
 
    配置SecureCRT上的RSA密钥,打开SecureCRT→Quick Connect→Authentiation→PublicKey→Properties→Create Identity File,Key选择RSA;Passphrase可以不同于密码,任意的字符串即可;Key length in为加密长度,可为512到2048位,要是在linux上可配置4096;
   下一步为生成过程,需要不停在进度条附近晃动鼠标,选择在x:\%USERPROFILE%\Application Data\VanDyke下生成两个文件,并且格式为Openssh Key format,要是选默认的Standard Public Key and VanDyke Private Key可能还需要格式转换或有兼容问题,公钥Identity.pub和私钥Identity。
 
二 将公钥上传到Linux的相应用户目录下的 .ssh文件夹
 
公钥Identity.pub上传到用户目录的.ssh目录里,修改文件名为authorized_keys,
 
[paul@CentOS .ssh]$ mv Indentity.pub authorized_keys
 
修改文件访问权限
 
[paul@CentOS .ssh]$ chmod 600 authorized_keys
 
三 配置sshd-config
 
vi /etc/ssh/sshd-config
 
PermitRootLogin no
 
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile      .ssh/authorized_keys
 
PermitEmptyPasswords no
PasswordAuthentication no
 
service sshd restart
 
四 现在即可使用相应普通帐号在SecureCRT + RSA密钥 进行ssh登录 Linux
 
 
总结: 可以通过Client产生RSA 公钥和私钥的密钥对,将公钥上传到Server端,可以完成RSA认证的过程,
      其中Client程序在认证过程中必须同时加载公钥和私钥,缺一不可,否则认证不成功。
posted @ 2015-08-19 17:25  Forward1990  阅读(1890)  评论(0编辑  收藏  举报