Skip to content

Commit 7d77d6b

Browse files
author
lerndevops
authored
Update ssh-keys-setup.md
1 parent a255824 commit 7d77d6b

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

ansible/install/ssh-keys-setup.md

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

3-
useradd botuser -m -d /home/botuser -s /bin/bash
3+
useradd naresh -m -d /home/naresh -s /bin/bash
44

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

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

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

1111
```
12-
1) switch to user ( su - botuser )
12+
1) switch to user ( su - naresh )
1313
2) run "ssh-keygen" command as user ( this will genereate ssh keys for the user )
1414
```
15-
16-
### copy user ssh keys from ansible contrller to all target hosts
17-
1815
```
19-
1) on ansible controller machine
20-
cd /home/botuser/.ssh
16+
on ansible controller machine
17+
cd /home/naresh/.ssh
2118
cat id_rsa.pub (copy the content)
2219
```
20+
### copy user ssh keys from ansible contrller to all target hosts
21+
2322
```
24-
2) on all taget machines
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)
23+
1) on all target machines
24+
swith to the user ( su - naresh )
25+
mkdir -p /home/naresh/.ssh
26+
touch /home/naresh/.ssh/authorized_keys
27+
chmod -R 700 /home/naresh/.ssh
28+
vi /home/naresh/.ssh/authorized_keys (enter the copied contet of id_rsa.pub from controller & save the file)
3029
```
3130

3231

0 commit comments

Comments
 (0)