6

Using Ubuntu server 14.04LTS I want to configure my UFW to limit ssh connections with the following command:

sudo ufw insert 1 limit ssh/tcp

which throws an error: ERROR: Invalid position '1'

Due to the fact that this command accepts no number at all there should be no other rule placed under number 1...

man ufw

outputs the following insert NUM RULE whereas RULE should be limit ssh/tcp. That said my syntax should be correct.

Anyone knows whats going on here?

1 Answer 1

4

This is because position '1' can only be valid if there is already existing at least a rule, so to insert your rule in position 1 you just need to insert a rule without position at all it will be default to position '1' from then on you can have position '2' or position '3'

1
  • I don't see it. I have same ipv6 rules added. And without controlling position they are not working, because rules before allows ports. Jun 5, 2023 at 15:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .