import directus db 3 modif ufw port ssh and ip
This commit is contained in:
parent
244742a8a1
commit
3d76ae8811
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue