2023-12-31 14:01:26 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2024-01-01 16:20:40 +01:00
|
|
|
userdel ansible
|
2024-01-01 16:19:50 +01:00
|
|
|
useradd -p '$6$CsCshZ6pxVNCn70J$ag/tZ9FBBxUizsMy8q7CUQpx0x.OYe3cU1vHut4wDZ/aq0XHOZ4xzkN2cazpuLzduxpxUHwFZhy2ESJzUT/X8.' -s /bin/bash ansible
|
2023-12-31 14:00:48 +01:00
|
|
|
usermod -aG sudo ansible
|
2024-01-01 16:22:13 +01:00
|
|
|
usermod -aG wheel ansible
|
2023-12-31 14:00:48 +01:00
|
|
|
mkdir -p /home/ansible/.ssh && echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC3JluNYq+SzgfmM2G/TI+hw1uliz6c4823otBj2IPTvdx6rpmRa+aTAb8Cl8NXT7ARCIeb4bYqWFhxr38DdwM+lGYP/2dhxxleKz9YYzkyaGvzZw//BuGiYU3FBpAv0eOOJC2nWh+PMJ/OCocrGojyjwxQeg5u3Zx+l5TAiybHCQWTfPgy5Wmn7ATmr4gS39pJg+UeyiCFKK28Tm+EzmnJaXEtTgaAWiWGSjjDlkwGr+Y7+LUh0xHFnF8FcBJCIJ3JV2+WkriTp2N59MIs/+sxvZI8STekIfhzznsHyvUnZSPI0DETqZQt7oGYMUbw/MGuZofEn2JgDThWQoxlwAltWZdDoedJ8ECUfL8yJf1t4i9zzrv5XiQ5auJBJHyK0Av23zQH1WCHlEALte9p9VSY/ieqldWAoYJl3tbiVklTytLsvQZvyW2/zr2rlUrr9Z/mFtYfux98hbpoe3sOqQP2JlqTdEdxGt0bH11BreFvvFJtqpXP1JnmwSmwcmabfIs= root@prod-infra-ansiblesemaphore" >> /home/ansible/.ssh/authorized_keys
|
|
|
|
chown ansible -R /home/ansible
|
|
|
|
chmod 700 /home/ansible/ && chmod 600 /home/ansible/.ssh/authorized_keys
|