modification and first test

This commit is contained in:
godot 2024-07-08 23:25:00 +02:00
parent e83b4c771f
commit 3fbcabaa63

View File

@ -19,10 +19,11 @@ mkdir /opt/minecraft
mv Forge-1.20.1.jar /opt/minecraft/
### cd /opt/minecraft/
### Husten we have a problem
java -Xms512M -Xmx2048M -jar Forge-1.20.1.jar --installServer
/bin/sleep 30
# /opt/minecraft/run.sh # it may needs to run before copying eula. But I dont want to mess with timing
# rm eula.txt # I hope this is not needed
@ -37,7 +38,7 @@ mv eula.txt /opt/minecraft/
mv server.properties /opt/minecraft/
rm run.sh
# rm run.sh
mv run.sh /opt/minecraft
@ -65,17 +66,24 @@ iptables -A INPUT -p tcp --dport 22 --source 172.18.42.0/24 -j ACCEPT #Allow ssh
iptables -A INPUT -p tcp --dport 25565 -j ACCEPT #Allow MC port
# iptables -L ### Good place to paste a manual check to not lock yourself out
iptables -L ### Good place to paste a manual check to not lock yourself out
iptables -P INPUT DROP #Disallow everythink else
echo -n "Proceed? [Y/n]: "
read ans
iptables -P FORWARD DROP #Block all forwarding
iptables -P OUTPUT ACCEPT #Allow all outgouing
if [[ "n" != "$ans" ]]; then
iptables -P INPUT DROP #Disallow everythink else
iptables -P FORWARD DROP #Block all forwarding
iptables -P OUTPUT ACCEPT #Allow all outgouing
fi
#### Intervention needed, after install it runs something and i dont know how to set it here
apt install iptables-persistent
apt install iptables-persistent -y
iptables-save > /etc/iptables/rules.v4
# iptables-save > /etc/iptables/rules.v4