To view your firewall settings in a terminal perform the following: -
sudo iptables -L -n
you looking for somehting ike this
# iptables -L -n
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:ssh
DROP all -- anywhere anywhere
if no port ssh (22) rule is set then try:
sudo iptables -I INPUT -p tcp -m tcp --dport 22 -j ACCEPT
save current iptables firewall rules to a file called /root/dsl.fw
, type:
# iptables-save > /root/dsl.fw
To restore iptables rules, enter:
iptables-restore < /root/dsl.fw
To restore rules automatically upon Linux system reboot add following command to your /etc/rc.local
file, enter:
# vi /etc/rc.local
Append the line:
/sbin/iptables-restore < /root/dsl.fw
To check what init services are running and at what run level try this in a terminal
ls /etc/rc*.d
if sshd is not listed do then enter this in your terminal:
update-rc.d ssh enable