• Hi, Pleskians! We are running a UX testing of our upcoming product intended for server management and monitoring.
    We would like to invite you to have a call with us and have some fun checking our prototype. The agenda is pretty simple - we bring new design and some scenarios that you need to walk through and succeed. We will be watching and taking insights for further development of the design.
    If you would like to participate, please use this link to book a meeting. We will sent the link to the clickable prototype at the meeting.
  • Our UX team believes in the in the power of direct feedback and would like to invite you to participate in interviews, tests, and surveys.
    To stay in the loop and never miss an opportunity to share your thoughts, please subscribe to our UX research program. If you were previously part of the Plesk UX research program, please re-subscribe to continue receiving our invitations.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.

Resolved Is it possible to make changes to Plesk Firewall from the command line?

HHawk

Regular Pleskian
Hi all,

I am trying to learn how to setup a server from the command line, instead of by using the Plesk control panel.
So far, I can manage everything from the command line. Which will be a time-saver, except for one thing; the Plesk Firewall.

Is it possible to make visible changes in there as well? For example I want to enable the Plesk Firewall from the command line and add a Passive Port (49152-65534) rule as well to it.

I cannot seem to find any information on how to do this through SSH / command line...

Please advice. Thanks.
 
Thanks IgorG...

Weird, I couldn't find that KB at all yesterday. I did actually search for it. Maybe I used the wrong search terms.
Anyways thank you!
 
Sometimes old articles get replaced by more detailed, better articles. There is a new article on this topic. Does the section "Managing firewall rules via a command-line interface" in
deliver what you are seeking?
Unfortunately not.
but I found in the meantime a workable solution with /usr/local/psa/bin/modules/firewall/settings. There one can se the entries with multiple IP's. That all I need, as I can do the confirmation in Plesk then.

I will document my way as soon as Im done.
For those who need urgent solution simply SSH to your system and enter
/usr/local/psa/bin/modules/firewall/settings --help.
(Just be carefull there are some errorsin the description, as the --set-rule command is not positional und comma separated, but just whitespace separated and non-positional.
For updates of rules the id-Parameter can be located in the Firewall-URL in Plesk.

I will not use the --apply and --confirm commands but check my entries in Plesk and do the apply in Plesk (as my issue was just to avoid entering tens of IP's manually.
BTW: this is the link which brought me onto this track
https://www.plesk.com/kb/support/how-to-manage-local-firewall-rules-using-plesk-firewall-in-plesk-for-linux/
 
Back
Top