forked from ChrisTitusTech/secure-linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsecure.sh
More file actions
executable file
·34 lines (29 loc) · 795 Bytes
/
Copy pathsecure.sh
File metadata and controls
executable file
·34 lines (29 loc) · 795 Bytes
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
#!/bin/bash
#-----------------------
#--Required Packages-
#-ufw
#-fail2ban
# --- Setup UFW rules
sudo ufw limit 22/tcp
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw enable
# --- Harden /etc/sysctl.conf
#sudo sysctl kernel.modules_disabled=1 # this one Chris Titus do not recommand in particular cases, see YT: https://www.youtube.com/watch?v=V-GYYrsNNSM&t=70s
sudo sysctl -a
sudo sysctl -A
sudo sysctl mib
sudo sysctl net.ipv4.conf.all.rp_filter
sudo sysctl -a --pattern 'net.ipv4.conf.(eth|wlan)0.arp'
# --- PREVENT IP SPOOFS
cat <<EOF > /etc/host.conf
order bind,hosts
multi on
EOF
# --- Enable fail2ban
sudo systemctl enable fail2ban
sudo systemctl start fail2ban
echo "listening ports"
sudo netstat -tunlp