Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
06-17-2003, 02:12 PM
|
#1
|
LQ Newbie
Registered: Jun 2003
Posts: 12
Rep:
|
port 22: connection refused
Could anybody tell me what the necessary and sufficient conditions are for a PC running RedHat 9 to accept ssh (scp etc.) connections? My box is connected to a local gateway and thus I set "no firewall" through redhat-config-securitylevel, yet I get a "Connection refused" (port 22) if I try to ssh it from other machines in the same network (ping works).
I didn't have this problem on another machine, on which I installed RedHat 9 from scratch; on the problematic one I upgraded a non-networked RedHat 7.3, so I believe that must be be related to the problem.
Any suggestions?
Thanx
|
|
|
06-17-2003, 02:16 PM
|
#2
|
Member
Registered: Jan 2002
Distribution: slackware
Posts: 193
Rep:
|
And ssh server is running.
|
|
|
06-17-2003, 02:27 PM
|
#3
|
LQ Newbie
Registered: Jun 2003
Posts: 12
Original Poster
Rep:
|
yeap:
root 589 0.3 0.0 3504 0 ? SW 21:23 0:00 /usr/sbin/sshd
|
|
|
06-17-2003, 02:31 PM
|
#4
|
Member
Registered: Jan 2002
Distribution: slackware
Posts: 193
Rep:
|
Does a port scan from a remote box show that 22 is open? And is there a firewall on any of the remote boxes.
|
|
|
06-17-2003, 02:54 PM
|
#5
|
LQ Newbie
Registered: Jun 2003
Posts: 12
Original Poster
Rep:
|
Humm. Port 22 is reported `closed' by nmap on the other box.
Yeah, the other box (which is connected to my ISP) has a firewall.
|
|
|
06-17-2003, 02:59 PM
|
#6
|
Member
Registered: Jan 2002
Distribution: slackware
Posts: 193
Rep:
|
See if ssh 127.0.0.1 works.
|
|
|
06-17-2003, 03:10 PM
|
#7
|
LQ Newbie
Registered: Jun 2003
Posts: 12
Original Poster
Rep:
|
Sorry, I forgot to say, I had checked that out before: it does.
|
|
|
06-17-2003, 03:20 PM
|
#8
|
Member
Registered: Jan 2002
Distribution: slackware
Posts: 193
Rep:
|
Then I dont know either the external boxes have firewalls limiting what gets out or the hosts.deny or hosts.allow files are limiting ssh.
|
|
|
06-17-2003, 03:25 PM
|
#9
|
LQ Newbie
Registered: Jun 2003
Posts: 12
Original Poster
Rep:
|
I set up the firewall on the other box using redhat-config-securitylevel, and I marked the ethernet interface going to this box as a `trusted device', specifically allowing SSH connections.
The hosts.deny file is empty, the hosts.allow file has ALL:ALL in it.
|
|
|
06-17-2003, 03:35 PM
|
#10
|
Member
Registered: Jan 2002
Distribution: slackware
Posts: 193
Rep:
|
On the computer your trying to ssh from can you ssh to other boxes besides the one the doesnt work? If you cant test it maybe try killing the firewall. Run iptables -L to make sure there are no rules left and everything is set to accept. Then try to connect to the box. If all that doesnt work I'm out of idea's.
|
|
|
06-17-2003, 03:40 PM
|
#11
|
LQ Newbie
Registered: Jun 2003
Posts: 12
Original Poster
Rep:
|
> On the computer your trying to ssh from can you ssh to other boxes
> besides the one the doesnt work?
Sorry, I forgot to tell you before: YES.
I don't know much about iptables, here is the output of iptables -L:
Chain INPUT (policy ACCEPT)
target prot opt source destination
RH-Lokkit-0-50-INPUT all -- anywhere anywhere
Chain FORWARD (policy ACCEPT)
target prot opt source destination
RH-Lokkit-0-50-INPUT all -- anywhere anywhere
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain RH-Lokkit-0-50-INPUT (2 references)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:http flags:SYN,RST,ACK/SYN
ACCEPT tcp -- anywhere anywhere tcp dpt:ftp flags:SYN,RST,ACK/SYN
ACCEPT tcp -- anywhere anywhere tcp dpt:ssh flags:SYN,RST,ACK/SYN
ACCEPT tcp -- anywhere anywhere tcp dpt:smtp flags:SYN,RST,ACK/SYN
ACCEPT udp -- anywhere anywhere udp spts:bootps:bootpc dpts:bootps:bootpc
ACCEPT udp -- anywhere anywhere udp spts:bootps:bootpc dpts:bootps:bootpc
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT udp -- bud-ink00.chello.hu anywhere udp spt:domain
ACCEPT udp -- bud-ink01.chello.hu anywhere udp spt:domain
REJECT tcp -- anywhere anywhere tcp flags:SYN,RST,ACK/SYN reject-with icmp-port-unreachable
REJECT udp -- anywhere anywhere udp reject-with icmp-port-unreachable
|
|
|
06-17-2003, 06:40 PM
|
#12
|
LQ Newbie
Registered: Jun 2003
Posts: 12
Original Poster
Rep:
|
Dear jstu,
thank you for your help. I just found the problem: there was a file /etc/sysconfig/ipchains with stuff in it, which I commented out, and now everything is fine. Isn't it a bug, by the way, that redhat-config-securitylevel does not delete or rename that file when one sets "no firewall"? And/or shouldn't it disable the ipchains services when one does not want a firewall?
Best --
|
|
|
06-17-2003, 07:55 PM
|
#13
|
Member
Registered: Jan 2002
Distribution: slackware
Posts: 193
Rep:
|
You would think so. If you want to run a firewall I would suggest learning iptables. The redhat gui tools are good but they prevent you from really know whats going on behind the scenes.
|
|
|
06-17-2003, 07:55 PM
|
#14
|
Member
Registered: Jan 2002
Distribution: slackware
Posts: 193
Rep:
|
mistake
|
|
|
All times are GMT -5. The time now is 06:02 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|