LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 10-18-2007, 02:10 AM   #1
MarioT
Member
 
Registered: May 2004
Posts: 52

Rep: Reputation: 15
ssh connection not working


Two PCes in a network, one Debian 4.0 r1, another Centos 5.0. I can connect from debian to centos via ssh but when I want to connect from centos to debian connection is not working. I get message "ssh: connect to host 10.100.250.253 port 22: Connection refused".
Ping works fine. In /etc/sshd_conf I have AllowRoot yes, in /etc/hosts_allow and denny I have nothing. No firewall is running. What could be the reason?

Thanks
Mario
 
Old 10-18-2007, 02:27 AM   #2
MarioT
Member
 
Registered: May 2004
Posts: 52

Original Poster
Rep: Reputation: 15
at the moment connection is working :-). I have no idea what was wrong.
 
Old 10-18-2007, 02:51 AM   #3
MarioT
Member
 
Registered: May 2004
Posts: 52

Original Poster
Rep: Reputation: 15
this machine gets me crazy, no it's not working again :-(((((.
 
Old 10-18-2007, 04:23 AM   #4
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
Quote:
Originally Posted by MarioT
In /etc/sshd_conf I have AllowRoot yes
For a start, disable that -- set it to AllowRoot no and do it now. There is absolutely no sane reason to allow remote root logins trough SSH, unless you want trouble (maybe not even then). You can just as well log in as a regular user and then use sudo to do things with root privileges, or maybe 'su' to become root if you don't know how to use sudo. But allowing root logins trough SSH means that anybody can start easily guessing your root password (brute-force ssh-login attack is a very simple and ugly way of doing that, for example; preventing direct root logins disables this kind of attack to determine root password).

Nevertheless it sounds odd. Are you sure the network connection is fine all the time? If
Code:
/sbin/iptables -L
shows empty tables (=no firewall), you don't have any external firewalls between the machines, the hosts allow/deny files are empty and you have sshd running without problems, I can't think of much else. I'd read trough the sshd configuration file to make sure there are no strange settings, and test the connection well.
 
Old 10-18-2007, 05:37 AM   #5
MarioT
Member
 
Registered: May 2004
Posts: 52

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by b0uncer View Post
Nevertheless it sounds odd. Are you sure the network connection is fine all the time? If
Code:
/sbin/iptables -L
shows empty tables (=no firewall)

/sbin/iptables -L says this


hssdgw:/etc# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination


I tried to mount on centos from debina via nfs and also got connection refused. Minute ago I tried again to mount and it works. Then I tried ssh, now it also working. But for how long? It already happened that it works for some time and then it stop :-(. Ping works always.
Is ther any network log file? It seems it's not just a ssh problem but network.

Thanks for helping me.
Mario
 
Old 10-18-2007, 06:00 AM   #6
linux4begin
LQ Newbie
 
Registered: Oct 2007
Location: India
Distribution: Ubuntu,RedHat,Suse Linux,DEBIAN.
Posts: 17
Blog Entries: 1

Rep: Reputation: 0
Smile dear had you check the /root/.ssh/know_hosts file

Dear

Please check the /root/.ssh/know_hosts file if you are trying with root user.
Some times due to old entry of ssh host keys you will not able to get login.

check this file and if you find any appropriate entry then you can remove it and then try, it will work.
 
Old 10-18-2007, 06:45 AM   #7
MarioT
Member
 
Registered: May 2004
Posts: 52

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by linux4begin View Post
Please check the /root/.ssh/know_hosts file if you are trying with root user.
Some times due to old entry of ssh host keys you will not able to get login.
I think it not the problem of ssh but something with network. I also tried to mount via nfs

[root@sigw tmp]# mount -t nfs 10.100.250.253:/export /import/
mount: mount to NFS server '10.100.250.253' failed: System Error: Connection refused.

NFS deamon on 10.100.250.253 is running ok. I managed to mount it few times, just like I connect via ssh sometimes.

Connection from debian machine to centos machine is working ok via ssh.
 
Old 10-19-2007, 05:27 AM   #8
MarioT
Member
 
Registered: May 2004
Posts: 52

Original Poster
Rep: Reputation: 15
the problem was another pc in the network with he same ip like my debian :-(.

Mario
 
  


Reply



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: connection to host port: 22: Connection timed out lost connection cucolin@ Linux - Server 4 11-22-2011 06:15 AM
ssh connection refused - trying to set up ssh server at home openSauce Linux - Server 10 10-18-2007 04:38 PM
SSH connection TL3 Linux - Newbie 2 11-22-2005 02:19 AM
problems getting remote ssh/X connection working fabs Linux - Newbie 6 03-01-2004 10:24 PM
ssh connection doodah Linux - Networking 2 05-09-2001 07:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:04 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
Open Source Consulting | Domain Registration