- Implementing DevOps with Ansible 2
- Jonathan McAllister
- 193字
- 2021-07-02 19:02:59
Setting up authentication between the control server and hosts
When connecting Ansible with remote hosts, Ansible's best practices encourage the use of SSH key sharing. SSH keys allow one Linux host to talk to another without asking for a specific password. In this section we are going to briefly look at how to set SSH key sharing up on the control server and n number of target machines.
If SSH key Sharing is not available Ansible also offers the option to ask for a password using the --ask-become-pass command-line argument.
To get started, create a /etc/ansible/hosts (if it doesn't exist) and add one or more remote systems into its contents. Your specific public SSH key should be located in authorized_keys on those target systems.
In this brief tutorial we will assume the SSH key authentication solution is being used. It helps us avoid having to enter or store raw passwords:
$ ssh-agent bash
$ ssh-add ~/.ssh/id_rsa
Now ping all the nodes (assumes you have an inventory file created):
$ ansible all -m ping
For a complete documentation set around setting up SSH key sharing in Ubuntu the documentation can be found at http://linuxproblem.org/art_9.html.
- 黑客攻防從入門到精通(實(shí)戰(zhàn)秘笈版)
- 自制編譯器
- 騰訊iOS測(cè)試實(shí)踐
- Python語言程序設(shè)計(jì)
- Instant Typeahead.js
- 假如C語言是我發(fā)明的:講給孩子聽的大師編程課
- 零基礎(chǔ)Java學(xué)習(xí)筆記
- 微信小程序開發(fā)與實(shí)戰(zhàn)(微課版)
- App Inventor 2 Essentials
- Maven for Eclipse
- 深度學(xué)習(xí)入門:基于Python的理論與實(shí)現(xiàn)
- 現(xiàn)代CPU性能分析與優(yōu)化
- Drupal Search Engine Optimization
- Learning Cocos2d-JS Game Development
- 零基礎(chǔ)學(xué)編程系列(全5冊(cè))