import directus db 3 modif ufw port ssh and ip

This commit is contained in:
Valentin 2024-04-17 17:16:02 +02:00
parent 244742a8a1
commit 3d76ae8811
1 changed files with 3 additions and 5 deletions

View File

@ -22,10 +22,7 @@ get_username() {
get_ip() {
if [[ -z "$ip" ]]; then
ip=$(hostname -I)
if [[ "${ip: -1}" == " " ]]; then
ip="${ip%?}"
fi
ip=$(hostname -I | cut -d' ' -f1)
fi
}
@ -104,7 +101,8 @@ if [[ "$answer" == "y" ]]; then
echo -e "${PURPLE}${BOLD}Setup Firewall and Fail2ban${RESET}"
apt install -y ufw fail2ban
systemctl enable fail2ban
ufw allow ssh
get_ssh_port
ufw allow $ssh_port
ufw allow http
ufw allow https
fi