sudo ufw allow ssh

Category: Self-Hosting

sudo ufw allow ssh

Open port 22 for SSH connections — always do this before enabling UFW on a remote server

Opens port 22 for SSH. This is the first rule you should add to UFW on any server you access remotely.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.