• TimTamJimJam@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    7 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
      link
      fedilink
      arrow-up
      0
      ·
      7 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.

      • aidan@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        7 months ago

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

      • octopus_ink@lemmy.ml
        link
        fedilink
        English
        arrow-up
        0
        ·
        7 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.

  • 7heo@lemmy.ml
    link
    fedilink
    arrow-up
    0
    ·
    7 months ago

    ufw is not a good software. I really tried to work with it. My solution was to disable it.

  • RustyNova@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    7 months ago

    I know I forgot to reactivate my firewall yesterday, but I’m too scared of getting locked in to do it remotely. I have physical access to it, but gotta wait after work

    • Cysioland@lemmygrad.ml
      link
      fedilink
      arrow-up
      0
      ·
      7 months ago

      Yeah, that’s my philosophy. Don’t mess with it unless I can get my ass in there and fix it in case it goes south.

  • TurboWafflz@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    7 months ago

    I accidentally put all the interfaces on my router running openwrt into the wrong firewall zone so now I can’t access it via ssh or the web interface. I already had it configured though and it still works so I’m just ignoring the problem until something breaks