LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices



Reply
 
Search this Thread
Old 11-15-2006, 12:40 PM   #1
sfarber53
LQ Newbie
 
Registered: Dec 2003
Location: Blacklick, OH
Distribution: CentOS 4.x; also OS X.4
Posts: 17

Rep: Reputation: 0
Unhappy 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
 
Old 11-15-2006, 12:43 PM   #2
doublejoon
Member
 
Registered: Oct 2003
Location: King George, VA
Distribution: RHEL/CentOS/Scientific/Fedora, LinuxMint
Posts: 366

Rep: Reputation: 44
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
 
Old 11-15-2006, 12:54 PM   #3
sfarber53
LQ Newbie
 
Registered: Dec 2003
Location: Blacklick, OH
Distribution: CentOS 4.x; also OS X.4
Posts: 17

Original Poster
Rep: Reputation: 0
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?
 
Old 11-15-2006, 02:40 PM   #4
doublejoon
Member
 
Registered: Oct 2003
Location: King George, VA
Distribution: RHEL/CentOS/Scientific/Fedora, LinuxMint
Posts: 366

Rep: Reputation: 44
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?
 
Old 11-15-2006, 03:08 PM   #5
sfarber53
LQ Newbie
 
Registered: Dec 2003
Location: Blacklick, OH
Distribution: CentOS 4.x; also OS X.4
Posts: 17

Original Poster
Rep: Reputation: 0
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!
 
Old 11-15-2006, 09:41 PM   #6
sfarber53
LQ Newbie
 
Registered: Dec 2003
Location: Blacklick, OH
Distribution: CentOS 4.x; also OS X.4
Posts: 17

Original Poster
Rep: Reputation: 0
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
 
Old 11-16-2006, 07:03 AM   #7
doublejoon
Member
 
Registered: Oct 2003
Location: King George, VA
Distribution: RHEL/CentOS/Scientific/Fedora, LinuxMint
Posts: 366

Rep: Reputation: 44
That looks pretty wide open

While physically at the ssh server machine can you ssh to localhost?
 
Old 11-16-2006, 12:27 PM   #8
sfarber53
LQ Newbie
 
Registered: Dec 2003
Location: Blacklick, OH
Distribution: CentOS 4.x; also OS X.4
Posts: 17

Original Poster
Rep: Reputation: 0
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
 
  


Reply

Tags
ssh, webmin


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SSH and CentOs, need help HyperTrey Linux - Desktop 6 10-18-2006 04:22 PM
SSH access problem on different Network ryancoolest Linux - Networking 2 07-30-2006 06:08 AM
Remote Access for CentOS 4 shole Linux - Software 2 04-10-2006 02:16 AM
CentOS 3.4 SSH Hangup wired420 Linux - General 3 01-27-2005 12:33 PM
Denying access to SSH but allow access to FTP nemesisza Linux - Security 5 03-14-2004 11:25 PM


All times are GMT -5. The time now is 01:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration