Hello friends.
I have a raspberry with raspbian buster, which I believe to be based on debian 10. I have it with openssh-server and openvpn running.
I have a script that downloads and uploads to different ftp servers that are not mine. The script is triggered using cron. I am using wget and curl. None of them work with ufw enabled, not even from the command line.
Here are the UFW rules:
Code: Select all
To Action From
-- ------ ----
22 ALLOW IN Anywhere
1194 ALLOW IN Anywhere
80 ALLOW IN Anywhere
443 ALLOW IN Anywhere
21 ALLOW IN Anywhere
20,21/tcp ALLOW IN Anywhere
22 (v6) ALLOW IN Anywhere (v6)
1194 (v6) ALLOW IN Anywhere (v6)
80 (v6) ALLOW IN Anywhere (v6)
443 (v6) ALLOW IN Anywhere (v6)
21 (v6) ALLOW IN Anywhere (v6)
20,21/tcp (v6) ALLOW IN Anywhere (v6)
21/tcp ALLOW OUT Anywhere
21 ALLOW OUT Anywhere
21/tcp (v6) ALLOW OUT Anywhere (v6)
21 (v6) ALLOW OUT Anywhere (v6)
When I disable UFW the script works fine. I have reset ufw various times and re-entered all the rules, one at a time, but without success.
I have another computer with debian 10 recently installed, same setup as the raspberry. Openssh-server and openvpn, and the exact same script triggered from cron. With only the ssh ports and vpn ports allowed in ufw, it works flawlessly.
Code: Select all
To Action From
-- ------ ----
22 ALLOW IN Anywhere
1194 ALLOW IN Anywhere
22 (v6) ALLOW IN Anywhere (v6)
1194 (v6) ALLOW IN Anywhere (v6)
I somehow believe that ufw on my raspberry is not setting up iptables correctly, and ufw reset is not working. What can I do? The easiest solution for me would be to reinstall from scratch as it would only take be about half an hour. But I know nothing about iptables and it might be educational to fix it instead of reinstalling. Can this be all fixed done via ssh without getting locked out as well?