SecureCRT 使用密钥登录 Ubuntu

记录 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

猜你喜欢

转载自www.cnblogs.com/GyForever1004/p/11408022.html