2 improve formatting
source | link

To allow incoming traffic on the default SSH port (22), you could tell iptables to allow all TCP traffic on that port to come in.

sudo iptables -A INPUT -p tcp --dport ssh -j ACCEPT

sudo iptables -A INPUT -p tcp --dport ssh -j ACCEPT

Referring back to the list above, you can see that this tells iptables:

  1. append this rule to the input chain (-A INPUT-A INPUT) so we look at incoming traffic
  2. check to see if it is TCP (-p tcp-p tcp).
  3. if so, check to see if the input goes to the SSH port (--dport ssh--dport ssh).
  4. if so, accept the input (-j ACCEPT-j ACCEPT).

Hopefully this works for you also you may want to add the ftp ports which are 20-21, just change the ssh to 20 and 21.

To allow incoming traffic on the default SSH port (22), you could tell iptables to allow all TCP traffic on that port to come in.

sudo iptables -A INPUT -p tcp --dport ssh -j ACCEPT

Referring back to the list above, you can see that this tells iptables:

  1. append this rule to the input chain (-A INPUT) so we look at incoming traffic
  2. check to see if it is TCP (-p tcp).
  3. if so, check to see if the input goes to the SSH port (--dport ssh).
  4. if so, accept the input (-j ACCEPT).

Hopefully this works for you also you may want to add the ftp ports which are 20-21, just change the ssh to 20 and 21.

To allow incoming traffic on the default SSH port (22), you could tell iptables to allow all TCP traffic on that port to come in.

sudo iptables -A INPUT -p tcp --dport ssh -j ACCEPT

Referring back to the list above, you can see that this tells iptables:

  1. append this rule to the input chain (-A INPUT) so we look at incoming traffic
  2. check to see if it is TCP (-p tcp).
  3. if so, check to see if the input goes to the SSH port (--dport ssh).
  4. if so, accept the input (-j ACCEPT).

Hopefully this works for you also you may want to add the ftp ports which are 20-21, just change the ssh to 20 and 21.

1
source | link

To allow incoming traffic on the default SSH port (22), you could tell iptables to allow all TCP traffic on that port to come in.

sudo iptables -A INPUT -p tcp --dport ssh -j ACCEPT

Referring back to the list above, you can see that this tells iptables:

  1. append this rule to the input chain (-A INPUT) so we look at incoming traffic
  2. check to see if it is TCP (-p tcp).
  3. if so, check to see if the input goes to the SSH port (--dport ssh).
  4. if so, accept the input (-j ACCEPT).

Hopefully this works for you also you may want to add the ftp ports which are 20-21, just change the ssh to 20 and 21.