62 lines
1.1 KiB
Bash
62 lines
1.1 KiB
Bash
#!/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 |