Hi everyone,
First, thank you for the amazing work on Yunohost. It really makes it easy to deploy services for me and my family.
I have a question related to the firewall configuration.
I would like to disable ssh access from everywhere except my home IP.
To do so, I created the following file, at /etc/yunohost/hooks.d/post_iptable_rules/95_ssh_from_home
:
#!/bin/bash
iptables -w -A INPUT -s <my_home_ip_address> -p tcp --dport=22 -j ACCEPT
exit 0
It is correctly interpreted, as shown with iptables -L -v
after reloading Yunohost firewall:
Chain INPUT (policy DROP 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
...
0 0 ACCEPT tcp -- * * <home_ip_address> 0.0.0.0/0 tcp dpt:22
...
The next step would be to remove yunohost’s ANY ACCEPT rule for port 22.
However, it does not seem to be possible to do this using yunohost’s tool, by design, to avoid loosing access to a remote box.
I have a backup access to my server using the QEMU novnc console from my VPS provider, and I know what I am doing.
Is there a cleaner way for me to disable the broad access to my ssh port than to manually insert an accept and a DROP rule at the beginning of the iptables firewall policy ?
Thank you in advance for your help,
Best regards,
Saxodwarf