When using UFW I see there are "applications" like OpenSSH or Apache, to name a couple. If I were to change my SSH default port to something other than the 22, would the OpenSSH application rule map to the new port? Or, do I need to manually add the rule for this new port?
The quickest way to manually add a new rule for a different SSH port would be with the following command:
inserting your particular port into the command.
While you haven't specifically asked, remember that you need to make your port number change in the file
/etc/ssh/sshd_config
. Be sure that you also remember to restart the sshd service after making your change(s) to the configuration file with the command:sudo systemctl restart sshd
.Working with ufw application profiles
Optionally, you could choose to either modify the existing ufw OpenSSH application profile directly, or create an entirely new application profile for your new SSH port.
Adapted from the
ufw
man page:See
man ufw
for additional implementation details.