-
Notifications
You must be signed in to change notification settings - Fork 0
/
script-iac.sh
executable file
·40 lines (32 loc) · 1.2 KB
/
script-iac.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
echo "criando diretorios..."
mkdir /publico
mkdir /adm
mkdir /ven
mkdir /sec
echo "criando grupos de usuarios..."
groupadd GRP_ADM
groupadd GRP_VEN
groupadd GRP_SEC
echo "criando usuarios do grupo ADM..."
useradd carlos -m -s /bin/bash -p $(openssl passwd -5 Senha123) -G GRP_ADM
useradd maria -m -s /bin/bash -p $(openssl passwd -5 Senha123) -G GRP_ADM
useradd joao -m -s /bin/bash -p $(openssl passwd -5 Senha123) -G GRP_ADM
echo "criando usuarios do grupo VEN..."
useradd debora -m -s /bin/bash -p $(openssl passwd -5 Senha123) -G GRP_VEN
useradd sebastiana -m -s /bin/bash -p $(openssl passwd -5 Senha123) -G GRP_VEN
useradd roberto -m -s /bin/bash -p $(openssl passwd -5 Senha123) -G GRP_VEN
echo "criando usuarios do grupo SEC..."
useradd josefina -m -s /bin/bash -p $(openssl passwd -5 Senha123) -G GRP_SEC
useradd amanda -m -s /bin/bash -p $(openssl passwd -5 Senha123) -G GRP_SEC
useradd rogerio -m -s /bin/bash -p $(openssl passwd -5 Senha123) -G GRP_SEC
echo "alterando grupo dos diretorios..."
chown root:GRP_ADM /adm
chown root:GRP_VEN /ven
chown root:GRP_SEC /sec
echo "alterando permissoes dos diretorios..."
chmod 770 /adm
chmod 770 /ven
chmod 770 /sec
chmod 777 /publico
echo "FINALIZADO!!!"