Skip to content

Commit 6b626ab

Browse files
author
lerndevops
authored
Update ssh-keys-setup.md
1 parent 9de1306 commit 6b626ab

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 ansiblebot -m -d /home/ansiblebot -s /bin/bash
3+
useradd botuser -m -d /home/botuser -s /bin/bash
44

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

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

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

1111
```
12-
1) switch to user ( su - ansiblebot )
12+
1) switch to user ( su - botuser )
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/ansiblebot/.ssh
20+
cd /home/botuser/.ssh
2121
cat id_rsa.pub (copy the content)
2222
```
2323
```
2424
2) on all taget machines
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)
25+
swith to the user ( su - botuser )
26+
mkdir -p /home/botuser/.ssh
27+
touch /home/botuser/.ssh/authorized_keys
28+
chmod -R 700 /home/botuser/.ssh
29+
vi /home/botuser/.ssh/authorized_keys (enter the copied contet of id_rsa.pub from controller & save the file)
3030
```
3131

3232

0 commit comments

Comments
 (0)