# Firewall modifications are not saved / cant close port 22

**URL:** <https://forum.yunohost.org/t/firewall-modifications-are-not-saved-cant-close-port-22/22595>\
**Category:** Support\
**Tags:** english\
**Created:** [December 12, 2022, 8:35am UTC](https://forum.yunohost.org/t/firewall-modifications-are-not-saved-cant-close-port-22/22595 "2022-12-12T08:35:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dosch](https://forum.yunohost.org/user_avatar/forum.yunohost.org/dosch/32/368_2.png) [@dosch](https://forum.yunohost.org/u/dosch)\
**Post date:** [December 12, 2022, 8:35am UTC](https://forum.yunohost.org/t/firewall-modifications-are-not-saved-cant-close-port-22/22595/1 "2022-12-12T08:35:47Z")

</div>

**Hardware:** VPS bought online  
**YunoHost version:** 1.0.10.2 (stable)  
**I have access to my server :** Through SSH | through the webadmin

### Description of my issue

- I tried to close port 22 in Home/Tools/Firewall on both IPv4 and IPv6.
- The webinterface asks me for confirmation (`Are you sure you want to close port 22 (protocol: TCP, connection: ipv4`) which I confirm
- the switch turns red: indicating the port is now closed.
- I navigate away from the page
- When I return to the page the ports are open and the switch indication is green again.

 ![Screenshot 2022-12-12 at 09.36.55](https://forum.yunohost.org/uploads/default/original/2X/8/81f3b02c56213010c1dd1f8349b7bf6c78c6607c.png)

I can also still connect over ssh, so indeed the port is still open.

Using Firefox 107.0.1 on MacOS 13.0.1 (22A400)

---

<div class="post-metadata">

**Author:** ![Aleks](https://forum.yunohost.org/user_avatar/forum.yunohost.org/aleks/32/1704_2.png) [@Aleks](https://forum.yunohost.org/u/Aleks)\
**Post date:** [December 12, 2022, 2:55pm UTC](https://forum.yunohost.org/t/firewall-modifications-are-not-saved-cant-close-port-22/22595/2 "2022-12-12T14:55:09Z")

</div>

Yes, I think there’s a specific bit of code to forbid closing port 22, because that can result in catastrophic consequences (loosing entire server access) if not inadvertently … I think the logic was “if you really want to disable SSH access, not forwarding the SSH port on your router should be enough”

---

<div class="post-metadata">

**Author:** ![dosch](https://forum.yunohost.org/user_avatar/forum.yunohost.org/dosch/32/368_2.png) [@dosch](https://forum.yunohost.org/u/dosch)\
**Post date:** [December 12, 2022, 3:03pm UTC](https://forum.yunohost.org/t/firewall-modifications-are-not-saved-cant-close-port-22/22595/3 "2022-12-12T15:03:00Z")

</div>

ah, but then maybe also not offering the option in the webinterface might avoid some confusion…  
Also, I do not have access to the router in the datacentre where my VPS lives… 😉

---

<div class="post-metadata">

**Author:** ![Aleks](https://forum.yunohost.org/user_avatar/forum.yunohost.org/aleks/32/1704_2.png) [@Aleks](https://forum.yunohost.org/u/Aleks)\
**Post date:** [December 12, 2022, 3:41pm UTC](https://forum.yunohost.org/t/firewall-modifications-are-not-saved-cant-close-port-22/22595/4 "2022-12-12T15:41:41Z")

</div>

Hmyeah clearly I would really advise against disabling port 22 if you’re on a VPS … Like, if for some reasons the webadmin becomes unavailable, this means you’re locked out of your server (unless you have “direct” access through a console from your VPS provider or something)

If your concern is about security, then consider changing the SSH port to some non-default value

---

<div class="post-metadata">

**Author:** ![dosch](https://forum.yunohost.org/user_avatar/forum.yunohost.org/dosch/32/368_2.png) [@dosch](https://forum.yunohost.org/u/dosch)\
**Post date:** [December 12, 2022, 6:31pm UTC](https://forum.yunohost.org/t/firewall-modifications-are-not-saved-cant-close-port-22/22595/5 "2022-12-12T18:31:00Z")

</div>

all good, wise and sound advice. Will look into them. Thnx @Aleks!

But please do remove the switch that doesn’t switch 😉

---

<div class="post-metadata">

**Author:** ![system](https://forum.yunohost.org/uploads/default/original/2X/f/f59fe8e3ee6b100b4f574d30d6e30479c68b89f0.png) [@system](https://forum.yunohost.org/u/system)\
**Post date:** [January 11, 2023, 6:31pm UTC](https://forum.yunohost.org/t/firewall-modifications-are-not-saved-cant-close-port-22/22595/6 "2023-01-11T18:31:42Z")

</div>

Closed on January 11, 2023, 6:31pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
