| 最流行的两种SSH身份验证机制是基于密码的身份验证和基于公钥的身份验证。使用SSH密钥通常比传统的密码身份验证更安全和方便。 |
环境
客户端:CentOS8 192.168.43.137
服务端:CentOS8 192.168.43.139
创建SSH公私钥
通过输入以下命令,生成新的4096位的SSH密钥对:
[root@localhost ~]# ssh-keygen -t rsa -b 4096 Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /root/.ssh/id_rsa. Your public key has been saved in /root/.ssh/id_rsa.pub. The key fingerprint is: SHA256:ycOtSDK8ud2kd6EH7OxoQuc1BFb1HJ3T/kvAQJt0LrI root@localhost.localdomain The key's randomart image is: +---[RSA 4096]----+ | ...oo.o o | | o .+=.+ .| | . . . +=. o | | . o.oo .o .| | +

本文介绍了在CentOS8环境下如何创建SSH公私钥,将公钥复制到远程服务器,以及如何使用密钥登录服务器,最后还提及了关闭密码认证的方法,提升服务器安全性。
最低0.47元/天 解锁文章
1012

被折叠的 条评论
为什么被折叠?



