Section: Firewalling with nftables and iptables

Allow SSH with nftables

bash
bash
sudo nft add rule inet filter input tcp dport 22 ct state new,established accept
Explanation

Permit inbound SSH traffic.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Firewalling with nftables and iptables
Allow SSH with iptables
Insert a rule allowing inbound SSH.
OpenIn sheetbashsame section
Show nftables rules
Display the active nftables ruleset.
OpenIn sheetbashsame section
Create nftables table
Create an inet filter table.
OpenIn sheetbashsame section
Create nftables chain
Create an input chain with a default policy.
OpenIn sheetbashsame section
Allow a port with UFW
Allow inbound TCP on a specific port.
OpenIn sheetbashsame section
Allow service with firewalld
Permanently allow the HTTPS service.
OpenIn sheetbashsame section