1.       SecureCRT 密钥生成

1.1       首先“工具”-“创建公钥”

 

1.2创建短语密码

 

 

 

 

2.       配置SSH服务器

vi /etc/sshd_config

修改以下内容

 

 
  
  1. Protocol 2 
  2. ServerKeyBits 1024 
  3. PermitRootLogin no  #禁止root登录而已,与本文无关,加上安全些 
  4.  
  5. #以下三行没什么要改的,把默认的#注释去掉就行了 
  6. RSAAuthentication yes 
  7. PubkeyAuthentication yes 
  8. AuthorizedKeysFile    .ssh/authorized_keys 
  9.  
  10. PasswordAuthentication no         //初次试验的时候最好用yes,否则配置错误的话重启sshd后你就悲剧了 
  11. PermitEmptyPasswords no 

 

3.       转换SecureCRT的公钥为OPENSSH密钥

上传刚才生成的Identity.pub到服务器,然后执行如下命令

ssh-keygen -i -f Identity.pub >> /root/.ssh/authorized_keys

在确定你的公钥加入到authorzed_keys后重启sshd服务

/etc/init.d/sshd restart

 

4.       使用SccureCRT登录服务器

首先设置登录模式为PublicKey,并选择刚刚创建的公钥文件Identity.pub

右键要连接的服务器—会话选项