Get 'connection was forcibly closed'
Have a Red Hat 9 server.
Am trying to connect to the server from a Windows 2000 machine (for a couple of different applications). Telnet is running on the server (I can self-connect to telnet on the server). If I try to connect from the Win box, I always get a "An existing connection was forcibly closed by the remote host" message. Wrote a simple TestPort routine in the Win box -- feed it an IP address and list of ports and it will try to open a socket connection to each port. Every port returns the same error as above (usually after about a 30 second delay). On the Linux box netstat shows listeners active for all the ports. Both machines are on the same sub-net, and I'm using IP addresses instead of names, so not going through any DNS. Both machines can ping each other. I'm a newbie to Linux, and suspect it's some type of authorization issue, but have been trolling the Web all day without coming up with an answer. Appreciate any help. Thanks. |
If you get that for all ports, it may be a firewall on the Linux box. Have you used nmap from http://www.insecure.org/nmap/ before? There is a Windows version so you can scan the Linux box from Windows and see what ports are open.
One the Linux box, have a look in /etc/init.d for a file called iptables (or firewall, or something like that). Try, as root, running service iptables stop and then run nmap again (or just try and telnet to the box). It may be that telnet is disabled - it's not the best choice for remote access. Have you tried ssh? |
May have solved this -- turned off the firewall.
Of course, in normal practice I want a firewall enabled, so what do I have to configure to let these ports through? |
The standard telnet port is 23 and the standard ssh port is 22. If you're using iptables, you can use something like:
For telnet Code:
iptables -t filter -A INPUT -p TCP --dport 23 -m state --state NEW,ESTABLISHED -j ACCEPT Code:
iptables -t filter -A INPUT -p TCP --dport 22 -m state --state NEW,ESTABLISHED -j ACCEPT |
Thanks
Stopping the firewall did the trick.
Thanks for the help and the link to NMAP. John |
All times are GMT -5. The time now is 06:50 AM. |