How to fastly add a new firewall rule through ssh
Posted: Tue Oct 04, 2022 11:47 am
In your SSH, as root, run:
Example to open port 22 for IP address 123.123.123.123:
Example to open port 8899 for the whole internet:
Code: Select all
sudo /usr/local/vesta/bin/v-add-firewall-rule 'ACCEPT/DROP' 'IP' 'PORT' 'TCP/UDP' 'Comment'
Code: Select all
sudo /usr/local/vesta/bin/v-add-firewall-rule 'ACCEPT' '123.123.123.123' '22' 'TCP' 'My custom SSH rule'
Code: Select all
sudo /usr/local/vesta/bin/v-add-firewall-rule 'ACCEPT' '0.0.0.0/0' '8899' 'TCP' 'Rule for 8899 port'