ansible_lxd_tests/local_lxd/scripts/01-Setup.bash

62 lines
1.1 KiB
Bash
Raw Permalink Normal View History

2022-09-15 00:18:11 -03:00
#!/bin/bash
aptGet() {
export DEBIAN_FRONTEND=noninteractive
export APT_LISTCHANGES_FRONTEND=none
apt-get -fuy autoremove
apt-get clean
apt-get update
apt-get upgrade
apt-get dist-upgrade
apt-get install \
openssh-server \
cron \
slapd \
ldap-utils \
wget \
ufw \
--yes
wget -qO ~/AccountManager.deb http://prdownloads.sourceforge.net/lam/ldap-account-manager_7.7-1_all.deb
apt install -f ~/AccountManager.deb --yes
}
sshConfig() {
ufw allow ssh
}
SSL() {
mkdir ~/LDAP-SSL
cd ~/LDAP-SSL || exit
openssl genrsa -aes128 -out LDAP.key 4096
## Admin user
U="letsencrypt"
P="letsencryptPazz.01!!"
G="sudo"
UUID="420"
UHOME="/home/admin"
adduser \
--disabled-login \
--home "$UHOME" \
--ingroup "$G" \
--uid "$UUID" \
--quiet "$U"
echo "$U:$P" | chpasswd
}
adminUser() {
U="admin"
P="admin"
G="sudo"
UUID="420"
UHOME="/home/admin"
adduser \
--disabled-login \
--home "$UHOME" \
--ingroup "$G" \
--uid "$UUID" \
--quiet "$U"
echo "$U:$P" | chpasswd
}
aptGet
#adminUser
sshConfig
#SSL
exit 0