说明:
随着自动化运维的发展,环境部署过程中服务器之间访问越加频繁,为方便访问部署主机间免密钥登录是提高效率的一种方式还有一些自动化运维工具Ansible、应用部署工具Jenkins等都需要免密钥提供支持,因此记录一下过程。
首次生成主机SSH密钥对,这其中包含公钥和私钥;
[root@CS01 ~]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Created directory '/root/.ssh'.
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:cqQNMf3Hn+iM10BzBprdczSvE1bT0lhWlCRJ+BJ6iHI root@CS01
The key's randomart image is:
+---[RSA 2048]----+

最低0.47元/天 解锁文章
1025

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



