Skip to content

Commit 79aae9b

Browse files
author
lerndevops
authored
Update ssh-keys-setup.md
1 parent b6604ba commit 79aae9b

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

ansible/install/ssh-keys-setup.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
### create a user on all machines ( controller & all targets )
22

3-
useradd ansible -m -d /home/ansible -s /bin/bash
3+
useradd ansiblebot -m -d /home/ansiblebot -s /bin/bash
44

55
### add user to sudoers for root previliges on all machines ( all targets )
66

7-
echo -e 'ansible ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/ansible
7+
echo -e 'ansiblebot ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/ansiblebot
88

99
### genereate ssh keys for above user on contrller machine
1010

1111
```
12-
1) switch to user ( su - ansible )
12+
1) switch to user ( su - ansiblebot )
1313
2) run "ssh-keygen" command as user ( this will genereate ssh keys for the user )
1414
```
1515

1616
### copy user ssh keys from ansible contrller to all target hosts
1717

1818
```
1919
1) on ansible controller machine
20-
cd /home/ansible/.ssh
20+
cd /home/ansiblebot/.ssh
2121
cat id_rsa.pub (copy the content)
2222
```
2323
```
2424
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)
3030
```
3131

3232

0 commit comments

Comments
 (0)