Originally Posted by blackhawk2165
I am trying to set up SSH on my linux machine. I have all the ssh packages downloaded and have added rules to my iptables i.e.
-A INPUT -p tcp -m tcp --dport 62222 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 21 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
I also saved all the rules in a file so I could restore the iptables when I reboot the machine.
I also checked to make sure that the ports were open on the network firewall.
So I'm not sure what to do now because everywhere I look it says that once I've added those rules it should work.
Have you checked if ssh is actually running? Which distro are you using? I am asking because the command to check whether ssh is running depends on your system's init system.
On debian it would be
Also please post your whole iptables script. If you are restricting the OUTPUT chain you also need to create rules to allow the ssh server to answer your requests.
If you have changed your ssh server config please also post that. Probably located at /etc/ssh/sshd_config but that also depends on your system. (Which ssh server are you running? Open-ssh, dropbear...?)
Can you actually ping the target machine from the client machine?
Last not least: Post the commands that you are running when you try to connect, and post the output! (Error messages etc.) Do not only say "it does not work" but describe what exactly does not work.