美文网首页
[持续集成] ansible 免密登陆

[持续集成] ansible 免密登陆

作者: w_w_wei | 来源:发表于2019-02-14 16:44 被阅读0次

生成秘钥,将公钥通过ssh-copy-id

ssh-keygen -t rsa   
ssh-copy-id -i /var/jenkins_home/.ssh/id_rsa.pub -p 20022 admin@192.168.3.15

输出如下

jenkins@b5dda696b2ee:/$ ssh-keygen -t rsa                                                                                                                                                                    
Generating public/private rsa key pair.                                                                                                                                                                      
Enter file in which to save the key (/var/jenkins_home/.ssh/id_rsa):                                                                                                                                         
Enter passphrase (empty for no passphrase):                                                                                                                                                                  
Enter same passphrase again:                                                                                                                                                                                 
Your identification has been saved in /var/jenkins_home/.ssh/id_rsa.                                                                                                                                         
Your public key has been saved in /var/jenkins_home/.ssh/id_rsa.pub.                                                                                                                                         
The key fingerprint is:                                                                                                                                                                                      
SHA256:ihdBNOQXkgYjvucifgVSUjSM7e7u0XpcRrS75UItWWY jenkins@b5dda696b2ee                                                                                                                                      
The key's randomart image is:                                                                                                                                                                                
+---[RSA 2048]----+                                                                                                                                                                                          
|  B+o+*..        |                                                                                                                                                                                          
| + =.+o+ .       |                                                                                                                                                                                          
|  =  .+ o        |                                                                                                                                                                                          
| . +   = E       |                                                                                                                                                                                          
|  + o o S        |                                                                                                                                                                                          
jenkins@b5dda696b2ee:/$ cd ~                                                                                                                                                                                 
jenkins@b5dda696b2ee:~$ ls .ssh                                                                                                                                                                              
id_rsa  id_rsa.pub  known_hosts                                                                                                                                                                              
jenkins@b5dda696b2ee:~$ ssh-copy-id -i /var/jenkins_home/.ssh/id_rsa.pub -p 20022 admin@192.168.3.15                                                                                                         
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/var/jenkins_home/.ssh/id_rsa.pub"                                                                                                            
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed                                                                                           
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys                                                                                         
admin@192.168.3.15's password:                                                                                                                                                                               
                                                                                                                                                                                                             
Number of key(s) added: 1                                                                                                                                                                                    
                                                                                                                                                                                                             
Now try logging into the machine, with:   "ssh -p '20022' 'admin@192.168.3.15'"                                                                                                                              
and check to make sure that only the key(s) you wanted were added.

相关文章

  • [持续集成] ansible 免密登陆

    生成秘钥,将公钥通过ssh-copy-id 输出如下

  • linux ssh 免密登陆排查技巧

    场景: 使用ssh免密登陆配置的时候。做了相关配置之后,尝试ssh免密登陆,还是提示输入密码,无法免密登陆。也没有...

  • Hadoop用户配置免密登陆

    Hadoop用户配置免密登陆,参考其他免密配置方法自己总结的更简洁的步骤。要实现A免密登陆B,需要把A生成的公钥放...

  • SSH 免密登陆

    SSH 免密登陆 本地机器 回车回车 这里要注意权限的问题,如果权限不对可能会导致无法免密登陆。

  • mac免密登陆ssh服务器

    1. git clone 2. ssh免密登陆

  • 免密登陆

    ssh-keygen -t rsa ssh-copy-id -i ~/.ssh/id_rsa.pub supers...

  • 单点登录之SAML

    这段时间出于大产品集成,我们尝试实现了系统认证从jwt到SAML的改造,以完成跨域免密登陆的功能。组里的小朋友单枪...

  • Zookeeper 集群部署

    0.集群环境 三台机器linux机器,并且相互免密登陆,安装好了java关于如何免密可以参考:https://ww...

  • Linux 设置免密登陆(Mac)

    设置ssh 免密登陆 前置条件: 安装ssh-copy-idbrew install ssh-copy-id 登陆...

  • linux配置ssh免密登陆

    通过执行该脚本,可以配置相应服务器ssh免密登陆

网友评论

      本文标题:[持续集成] ansible 免密登陆

      本文链接:https://www.haomeiwen.com/subject/rwjdeqtx.html