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

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.

主站蜘蛛池模板: 治县。| 和顺县| 梧州市| 西城区| 融水| 延川县| 万山特区| 深水埗区| 陆良县| 内乡县| 宁夏| 凤凰县| 武宁县| 阿坝| 柘城县| 五峰| 含山县| 专栏| 鄂托克前旗| 略阳县| 驻马店市| 南靖县| 台安县| 贵港市| 丽水市| 广宗县| 海南省| 兴文县| 德昌县| 兴山县| 永和县| 定远县| 夏津县| 金塔县| 二连浩特市| 同德县| 南部县| 图木舒克市| 淮南市| 长治县| 饶河县|