Tag: Linux

Forward Ports Through a Linux Gateway with iptables NAT

Why Your Port Forwarding Isn’t Working A very common mistake with port forwarding on Linux is assuming a single DNAT rule is enough. You add one iptables rule, try to hit your server from outside, and… nothing. In reality, proper forwarding through a Linux gateway needs three things working together: IP forwarding in the kernel, packet filtering rules in the…

Read More »
How to Edit the sudoers File Safely with visudo

How to Edit the sudoers File Safely with visudo

If you break your sudoers file, you can lock yourself out of root. That’s the nightmare we’re trying to avoid here. This guide is for anyone managing Linux servers (VPS, bare metal, cloud instances) who needs to give or adjust sudo access without shooting their future self in the foot. I’ll walk you through how to use visudo correctly, how…

Read More »
How to Read and Set Environment Variables on Linux (Bash)

How to Read and Set Environment Variables on Linux (Bash)

If you’ve ever SSH’d into a server, changed some setting, and then… nothing happened, there’s a good chance environment variables were involved. Before: your script can’t find programs, your app can’t see its config, and every new shell feels like it “forgets” what you just set. After: you know exactly how to view, set, export, and persist environment variables so…

Read More »