1. SecureCRT 密钥生成
1.1 首先“工具”-“创建公钥”
1.2创建短语密码
2. 配置SSH服务器
vi /etc/sshd_config
修改以下内容
- Protocol 2
- ServerKeyBits 1024
- PermitRootLogin no #禁止root登录而已,与本文无关,加上安全些
- #以下三行没什么要改的,把默认的#注释去掉就行了
- RSAAuthentication yes
- PubkeyAuthentication yes
- AuthorizedKeysFile .ssh/authorized_keys
- PasswordAuthentication no //初次试验的时候最好用yes,否则配置错误的话重启sshd后你就悲剧了
- 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。
右键要连接的服务器—会话选项
转载于:https://blog.51cto.com/bubble/1073076