717
Firewall (lemmy.world)
you are viewing a single comment's thread
view the rest of the comments
[-] TimTamJimJam@lemmy.world 118 points 9 months ago

Happened to me in work once... I was connected via SSH to one of our test machines, so I could test connection disruption handling on a product we had installed.

I had a script that added iptables rules to block all ports for 30 seconds then unblock them. Of course I didn't add an exception for port 22, and I didn't run it with nohup, so when I ran the script it blocked the ports, which locked me out of SSH access, and the script stopped running when the SSH session ended so never unblocked the ports. I just sat there in awe of my stupidity.

[-] krash@lemmy.ml 3 points 9 months ago

Out of curiousity, how would nohup make your situation different? As I understand, nohup makes it possible to keep terminal applications running even when the terminal session has ended.

[-] octopus_ink@lemmy.ml 7 points 9 months ago

If the script was supposed to wait 30 secs and then unblock the ports, running with nohup would have allowed the ports to be unblocked 30 secs later. Instead, the script terminated when the SSH session died, and never executed the countdown nor unblock.

[-] krash@lemmy.ml 4 points 9 months ago

Thanks for the elaborate answer!

[-] octopus_ink@lemmy.ml 3 points 9 months ago
[-] aidan@lemmy.world 5 points 9 months ago

the script stopped running when the SSH session ended so never unblocked the ports

load more comments (11 replies)
this post was submitted on 16 Feb 2024
717 points (97.6% liked)

Programmer Humor

32561 readers
400 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS