官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 广宁县| 南充市| 井冈山市| 克什克腾旗| 侯马市| 沅江市| 广宁县| 揭西县| 蒲江县| 云梦县| 石台县| 巴马| 巍山| 磴口县| 察哈| 绥德县| 古蔺县| 柳河县| 贵南县| 石泉县| 贵州省| 定安县| 巨野县| 武宁县| 沙田区| 双峰县| 长宁县| 山东省| 个旧市| 漳浦县| 中超| 甘肃省| 嵊泗县| 临潭县| 信丰县| 来宾市| 施秉县| 浮山县| 长汀县| 湘潭县| 广元市|