6

Hi guys, i have a serious question

I have added port 22777 to UFW to allow ssh through that port then i notice that it wouldn't work, after some time wasting, i added the same rule to iptables, then it worked, why do I have to add the same rules here and there twice? Is Ufw just a decorative app? WTF is going on? How to get rid of iptables and use only ufw? why should i allow the port twice, I need your answers please

Comments
  • 2
    1. add the rule via UFW

    2. add the rule via iptables

    3. get the ufw-created rule via iptables (iptables -S | grep 22777)

    4. compare the rules to see why one of them doesn't work
  • 4
    Dumb question, but is ssh listening on 22777?
  • 2
    @ScriptCoded No, the default port is 22 but i changed it to be 22777
  • 0
    @netikras yes but why doing the same thing twice that's the problem
  • 0
    if you have ufw enabled, that's on you.
  • 1
    @melezorus34 how? I hope iptables is not your cousin
  • 1
    @dIREsTRAITS bruh how sleep deprived i am, i meant ip fucking tables. Fuck.

    if you want to manage with ufw, then disable iptables.
  • 0
    @melezorus34 bruh, chill and calm down, ufw and iptables are related, how can you make them divorce? what you mean with disable it.
  • 0
    Weird, I don't remember having this problem, and I also use an alternative Port for ssh. Iirc it just worked out of the box hmm
  • 0
    @dIREsTRAITS the point is triaging
  • 0
    Do an debugging of your ssh connection

    ssh -vvv you@yourhost
  • 0
    Ffs, just do those 4 steps and see how these 2 rules added in different ways differ. That will most likely hint you the answer what might be missing in the uwf command. An if there's only 1 rule in iptables -S output, it means uwf is not functioning at all and only the rule you added through iptables was actually added
  • 0
    @netikras do you think i should remove and reset everything? because anything i add to ufw is like decorations unless it's added to iptables
  • 0
    @dIREsTRAITS IDK what you mean by decorations.

    For testing purposes, you could whitelist some arbitrary port, say 62770 - that would make testing and comparing the rules created by both mechanisms possible w/o any trash and the need for a reset.
  • 1
    @dIREsTRAITS ... I have it disabled.

    only ufw is enabled...
  • 0
    @melezorus34 Okay, I will try that
  • 1
    Indeed guys, the iptables had some unknown conflicts with ufw, after resetting purging everything reinstalling, now anything i add to ufw will be applied successfully.

    Thank you everyone
  • 0
    @dIREsTRAITS iptables does a funny.

    btw what was your rule?
    cuz TIL i was writing mine wrong lol

    oh also ufw totes run over iptables, my bad lolol
Add Comment