sudo apt install dante-server
sudo rm /etc/danted.conf
sudo nano /etc/danted.conf
# /etc/danted.conf
logoutput: syslog
user.privileged: root
user.unprivileged: nobody
# The listening network interface or address.
internal: 0.0.0.0 port=1337
# The proxying network interface or address.
external: eth0
# socks-rules determine what is proxied through the external interface.
# The default of "none" permits anonymous access.
socksmethod: username
# client-rules determine who can connect to the internal interface.
# The default of "none" permits anonymous access.
clientmethod: none
client pass {
from: 0.0.0.0/0 to: 0.0.0.0/0
log: connect disconnect error
}
socks pass {
from: 0.0.0.0/0 to: 0.0.0.0/0
log: connect disconnect error
}
# sudo ufw allow 1337
service danted restart
netstat -nlpt | grep dant
sudo adduser $your_dante_user --shell=/bin/false --no-create-home
Install fail2ban / crowdsec
iptables -I INPUT -p tcp -s $managmentip --dport 22 -j ACCEPT
iptables -A INPUT -p tcp -s 0.0.0.0/0 --dport 22 -j DROP
iptables -A INPUT -p tcp -s 0.0.0.0/0 --dport 1337 -j ACCEPT
iptables -A INPUT -p udp -s 0.0.0.0/0 --dport 1337 -j ACCEPT
iptables-save