To open port 22 (the default SSH port) for incoming traffic using ufw on Ubuntu/Debian Linux, use the following command:
sudo ufw allow 22/tcp
You can verify that the port is open by checking the status of ufw:
sudo ufw status
You should see output similar to the following, indicating that port 22 is open for incoming traffic:
Status: active
To Action From
-- ------ ----
22/tcp ALLOW Anywhere