No ssh access after installing fail2ban and editing iptables
I followed the steps here:
in relation to installing fail2ban and changing my iptables config — I followed the steps in that article but have now lost ssh access to my linode.
I can get in via Lish but am unsure what to do next to restore access.
If I run
sudo iptables -L -n
, I get the following:
Chain INPUT (policy ACCEPT)
target prot opt source destination
fail2ban-ssh tcp -- 0.0.0.0/0 0.0.0.0/0 multiport dports 22
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
REJECT all -- 0.0.0.0/0 127.0.0.0/8 reject-with icmp-port-unreachable
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:443
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22
ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0
LOG all -- 0.0.0.0/0 0.0.0.0/0 limit: avg 5/min burst 5 LOG flags 0 level 7 prefix "iptables denied: "
DROP all -- 0.0.0.0/0 0.0.0.0/0
Chain FORWARD (policy ACCEPT)
target prot opt source destination
DROP all -- 0.0.0.0/0 0.0.0.0/0
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
Chain fail2ban-ssh (1 references)
target prot opt source destination
RETURN all -- 0.0.0.0/0 0.0.0.0/0
And at this stage, /var/log/fail2ban.log only reveals:
2013-10-24 20:30:23,662 fail2ban.server : INFO Changed logging target to /var/log/fail2ban.log for Fail2ban v0.8.6
2013-10-24 20:30:23,665 fail2ban.jail : INFO Creating new jail 'ssh'
2013-10-24 20:30:23,665 fail2ban.jail : INFO Jail 'ssh' uses poller
2013-10-24 20:30:23,747 fail2ban.filter : INFO Added logfile = /var/log/auth.log
2013-10-24 20:30:23,752 fail2ban.filter : INFO Set maxRetry = 6
2013-10-24 20:30:23,757 fail2ban.filter : INFO Set findtime = 600
2013-10-24 20:30:23,760 fail2ban.actions: INFO Set banTime = 600
2013-10-24 20:30:23,927 fail2ban.jail : INFO Jail 'ssh' started
Any clues on how to restore ssh access would be appreciated.