Last active
August 29, 2015 14:16
-
-
Save robertu7/7e405a92c87bd8088861 to your computer and use it in GitHub Desktop.
使用 SSH 证书登录
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. 本地生成公私钥:ssh-keygen -t rsa | |
2. 复制 id_rsa.pub 到 远端 .ssh/authorized_keys(权限:644) | |
3. 修改配置 /etc/ssh/sshd_config | |
- RSAAuthentication yes | |
- PubkeyAuthentication yes | |
- AuthorizedKeysFile .ssh/authorized_keys | |
- 可选:PasswordAuthentication no | |
4. 重启 sshd 服务:service sshd restart | |
5. 注意本地 id_rsa 文件权限 | |
# https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys--2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment