SecureCRT 使用密钥登录 Ubuntu

孤街浪徒 提交于 2019-11-28 12:59:59

记录 SecureCRT 通过 SSH 使用密钥登录 Ubuntu。

具体步骤如下:

1. 使用 SecureCRT 生成密钥对:
    工具 -> 创建公钥 -> 密钥类型 RSA -> 密钥格式 OpenSSH

2. 上传公钥至 Ubuntu:
    将公钥拷贝至用户目录下 .ssh 下

3. 配置 sshd_config:
    sudo vim /etc/ssh/sshd_config

4. 修改或添加内容如下:
    PubkeyAuthentication yes
    RSAAuthentication yes
    AuthorizedKeysFile .ssh/Identity.pub
    # 禁止使用密码登录,可不设置
    PasswordAuthentication no 

5. 重启 ssh 服务器:
    sudo /etc/init.d/ssh restart

 

所有配置完成后,即可使用 SecureCRT 进行登录,如登录不成功可能是公钥的权限不正确,可通过以下命令更改。

chmod 600 Identity.pub

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!