diff --git a/guides/linux-basics.md b/guides/linux-basics.md index 4f72943..75d1190 100644 --- a/guides/linux-basics.md +++ b/guides/linux-basics.md @@ -57,3 +57,24 @@ This guide provides a brief introduction to Linux, including basic commands and - Extract a tar archive: `tar -xvf ` - Create a zip archive: `zip ` - Extract a zip archive: `unzip ` + +## Networking + +- Get all interface ips: `ip a` +- Ping a host: `ping ` +- Get the public IP: `curl ifconfig.me` +- Get the public IP (alternative): `curl ipinfo.io/ip` + +## Firewall (UFW) + +Make sure to allow SSH before enabling the firewall, otherwise you will be locked out of your server. `sudo ufw allow ssh` + +- Enable the firewall: `sudo ufw enable` +- Disable the firewall: `sudo ufw disable` +- List all rules: `sudo ufw status` +- List all rules (showing numbers): `sudo ufw status numbered` +- Delete a rule: `sudo ufw delete ` +- Allow a port: `sudo ufw allow ` +- Deny a port: `sudo ufw deny ` +- Allow a service: `sudo ufw allow ` +- Deny a service: `sudo ufw deny `