LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   SSH Access Problem on CentOS 4.3 (http://www.linuxquestions.org/questions/linux-networking-3/ssh-access-problem-on-centos-4-3-a-501880/)

sfarber53 11-15-2006 11:40 AM

SSH Access Problem on CentOS 4.3
 
I am currently building-up a box to act as a router. In order to deal with the firewall, etc., I added Webmin with SSL access. SSH was working, but now it is broken.

The message I get when I try to connect is:

"Server unexpectedly closed network connection."

I've checked all of the settings, both through Webmin and from the console terminal, but I can't find the fault.

Can anyone help me out on this?

Thanks,

Steve

doublejoon 11-15-2006 11:43 AM

Check if ssh is even running

service sshd status

or

/etc/init.d/sshd status

or

netstat -pan | grep ssh

or

nmap -sT localhost


look for port 22


If you see nothing then

service sshd start

or

/etc/init.d/sshd start

sfarber53 11-15-2006 11:54 AM

SSH Problem on CentOS 4.3
 
I tried what you suggested and this is what I got:


[root@router ~]# netstat -pan | grep ssh
tcp 0 0 :::22 :::* LISTEN 6532/sshd
unix 2 [ ACC ] STREAM LISTENING 14462 5343/ssh-agent /tmp/ssh-STPerD5342/agent.5342
[root@router ~]#

I've tried stopping and starting ssh, but no luck.

Any other ideas?

doublejoon 11-15-2006 01:40 PM

Code:

iptables -L
paste your output


also check /etc/hosts.deny /etc/hosts.allow




kinda strange......now this happened only after you put webmin on your system?

sfarber53 11-15-2006 02:08 PM

SSH Access Problem on CentOS 4.3
 
I'm at work right now, but I pulled this log material from Webmin thinking that it might help.

Nov 15 11:25:34 router sshd[4992]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.
Nov 15 11:28:49 router sshd[4992]: Received SIGHUP; restarting.
Nov 15 11:28:50 router sshd[5025]: Server listening on :: port 22.
Nov 15 11:28:50 router sshd[5025]: error: Bind to port 22 on 0.0.0.0 failed: Address already in use.

I'll be back in touch (literally) with the system later tonight.

Thanks!

sfarber53 11-15-2006 08:41 PM

Output of iptables -L
 
Output from iptables -L ..

Chain INPUT (policy ACCEPT)
target prot opt source destination
RH-Firewall-1-INPUT all -- anywhere anywhere

Chain FORWARD (policy ACCEPT)
target prot opt source destination
RH-Firewall-1-INPUT all -- anywhere anywhere

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Chain RH-Firewall-1-INPUT (2 references)
target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT icmp -- anywhere anywhere icmp any
ACCEPT ipv6-crypt-- anywhere anywhere
ACCEPT ipv6-auth-- anywhere anywhere
ACCEPT udp -- anywhere 224.0.0.251 udp dpt:5353
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh
ACCEPT udp -- anywhere anywhere udp dpt:ipp
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:http
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:https
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ftp
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:10000
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited

doublejoon 11-16-2006 06:03 AM

That looks pretty wide open

While physically at the ssh server machine can you ssh to localhost?

sfarber53 11-16-2006 11:27 AM

Hi doublejoon,

Sitting at the machine, what I get is noted below:

Quote:

Originally Posted by doublejoon
That looks pretty wide open

While physically at the ssh server machine can you ssh to localhost?

[root@router ~]# ssh root@localhost
ssh_exchange_identification: Connection closed by remote host
[root@router ~]# ssh root@localhost:22
ssh: localhost:22: Name or service not known
[root@router ~]# ssh root@192.168.1.7
ssh_exchange_identification: Connection closed by remote host
[root@router ~]# ssh root@192.168.1.7:22
ssh: 192.168.1.7:22: Name or service not known
[root@router ~]#

I'm really mystified by this. I am having the same problem with another server. SSH was working and then quit and I can't get it back.

Many thanks for your help.

- Steve


All times are GMT -5. The time now is 07:03 AM.