File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change 1
1
### create a user on all machines ( controller & all targets )
2
2
3
- useradd ansible -m -d /home/ansible -s /bin/bash
3
+ useradd ansiblebot -m -d /home/ansiblebot -s /bin/bash
4
4
5
5
### add user to sudoers for root previliges on all machines ( all targets )
6
6
7
- echo -e 'ansible ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/ansible
7
+ echo -e 'ansiblebot ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/ansiblebot
8
8
9
9
### genereate ssh keys for above user on contrller machine
10
10
11
11
```
12
- 1) switch to user ( su - ansible )
12
+ 1) switch to user ( su - ansiblebot )
13
13
2) run "ssh-keygen" command as user ( this will genereate ssh keys for the user )
14
14
```
15
15
16
16
### copy user ssh keys from ansible contrller to all target hosts
17
17
18
18
```
19
19
1) on ansible controller machine
20
- cd /home/ansible /.ssh
20
+ cd /home/ansiblebot /.ssh
21
21
cat id_rsa.pub (copy the content)
22
22
```
23
23
```
24
24
2) on all taget machines
25
- swith to the user ( su - ansible )
26
- mkdir -p /home/ansible /.ssh
27
- touch /home/ansible /.ssh/authorized_keys
28
- chmod 600 /home/ansible /.ssh/authorized_keys
29
- vi /home/ansible /.ssh/authorized_keys (enter the copied contet of id_rsa.pub from controller & save the file)
25
+ swith to the user ( su - ansiblebot )
26
+ mkdir -p /home/ansiblebot /.ssh
27
+ touch /home/ansiblebot /.ssh/authorized_keys
28
+ chmod -R 700 /home/ansiblebot /.ssh
29
+ vi /home/ansiblebot /.ssh/authorized_keys (enter the copied contet of id_rsa.pub from controller & save the file)
30
30
```
31
31
32
32
You can’t perform that action at this time.
0 commit comments