How to Add a Swap File on Ubuntu 26.04

How to Add a Swap File on Ubuntu 26.04

A 2 GB swap file added on Ubuntu 26.04, including the insecure permissions 0644 warning most guides skip and how to test fstab without rebooting.