[SOLVED] SSH/sftp client closes unexpectedly.

Support for the other architectures (X86_64, IA-64, and PowerPC)
lurk
Posts: 6
Joined: 2010/07/31 10:22:43
Contact:

[SOLVED] SSH/sftp client closes unexpectedly.

Post by lurk » 2010/07/31 10:49:44

Hello everyone! i have recently installed a fresh copy of CentOS 5 x86_64 with the "server" package, right after installation i try to access ssh using putty/winscp with root login and i get "Connection Refused" instantly so i read up on search engines and found that rootlogin is enabled by default so i try editing /etc/hosts deleted a few extra lines the installation had created and was able to login for a split second so then i ran ssh in debug mode and found an error which stated "reverse mapping checking getaddrinfo for myhost.pacbell.net failed - POSSIBLE BREAKIN ATTEMPT" so i read up on that in the forums and found that i had to disable UseDNS in sshd_config and now /var/log/secure does not throw any errors, but now i still run into the same problem where the connection is refused by server right after i login to putty/sftp client successfully. The only changes i've made to sshd_config is disabling UsePAM and UseDNS and uncommented out ListenAdress 0.0.0.0. I have also went ahead and edited /etc/hosts.allow and added the following line: ALL : ALL : allow ....All my firewalls are disabled by chkconfig iptables off I have pretty much ran out of ideas and can't seem to find anything similar in the search engines. As information I login to my machine through IPMI this is a dedicated server i am renting and support isn't very helpful since they just want to charge me the installation fee i had told them to take a look at my sshd_config file but they refuse since this is self-managed server. Any help would be greatly appreciated. Thanks. :)

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

[SOLVED] SSH/sftp client closes unexpectedly.

Post by pschaff » 2010/08/01 01:29:05

Welcome to the CentOS fora. The following reading is recommended for new users:
[url=http://www.centos.org/modules/newbb/viewtopic.php?topic_id=14274&forum=47]Readme First[/url]
[url=http://www.centos.org/modules/newbb/viewtopic.php?topic_id=14408&forum=47]Installing Software[/url]
[url=http://www.centos.org/modules/newbb/viewtopic.php?topic_id=14273&forum=47]Where to Find Answers[/url]
[url=http://www.centos.org/modules/newbb/viewtopic.php?topic_id=25128&forum=47]How to provide information about your system[/url]

About all I can tell from the information provided is that you have made your system a [b]lot[/b] less secure. The lines in /etc/hosts are usually necessary and should not be removed. Logging in with ssh should not be hard. A common approach is to only allow logins as a normal user who can then [url=http://wiki.centos.org/TipsAndTricks/BecomingRoot]become root[/url]. After reviewing the recommend reading you might discover [url=http://wiki.centos.org/?action=fullsearch&context=180&value=ssh&titlesearch=Titles]some help on the Wiki[/url]. You may also want to read [url=http://wiki.centos.org/HowTos/Security]HowTos/Security[/url].

I'd recommend playing around more with the current install, consider your experiments as a learning experience and then do a fresh install.

lurk
Posts: 6
Joined: 2010/07/31 10:22:43
Contact:

Re: SSH/sftp client closes unexpectedly.

Post by lurk » 2010/08/01 02:34:58

Yes i also tried creating a normal user login but it wont connect at all, I even created a test login for a friend in mexico to login and he says he has the same problem he connects for a split second then the server boots him with "Connection Refused" then after that the server becomes totally unreachable with the same reason "Connection Refused" and just as info. to test things out i have also went ahead and installed a fresh copy of freebsd 8-release then ubuntu 10.04 LTS and i have the same problem with those installations also so i am guessing it might be something with my sshd_config....but like i said on the previous post...the only things I changed where disabling "UseDNS no", "UsePAM no" and uncommenting "ListenAddress 0.0.0.0" i had a feeling with changing that was enough. I would also like to mention i have two network interface cards.....i have only setup 1 (eth0).....you guys think maybe that is it???? it connects to the internet perfectly it was just a thought. I currently own a VPS apart from the dedicated server and i am trying to compare both sshd_config and ssh_config files and i see only 1 option which is different from mine and that is GSSAPIAuthentication i will see if enabling this will work....i'm on my 7th reinstallation hope this will be the lucky one 4 me..........thanks for your fast reply pschaff!

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: SSH/sftp client closes unexpectedly.

Post by pschaff » 2010/08/01 02:44:39

All those changes should not be necessary. A minimalist approach is best - start with the default configuration and change one thing at a time if necessary, then test.

What does [code]service sshd status[/code]show?

Does it work with the firewall off? Have you opened port 22 in the firewall for the IP addresses from which you are attempting to connect?

lurk
Posts: 6
Joined: 2010/07/31 10:22:43
Contact:

Re: SSH/sftp client closes unexpectedly.

Post by lurk » 2010/08/01 08:52:40

yes i have included a screen shot of my iptables since i cant copy n paste. i have also completely disabled it... i was able to change the error message by changing my authentication configuration in the "setup" screen after selecting authentication configuration under user information i choose "Cache Information" after that i rebooted then when i tried again i just got "Connection Timeout" in putty and when i delete that option i go back to "Connection Refused." this is a fresh install i did minimal and still got the same connection refused so i went ahead and just modified the sshd_config file with the options mentioned above 1 option at a time but no luck....i've modified /etc/sysconfig/iptables to output log into /var/logs/messages but i see no errors or nothing strange also looked in /var/logs/secure and sshd seems to be binding to 0.0.0.0 on port 22 without a problem and when i am "actually" able to login for that split second i do see it in that log file but no error i enter and exit like if nothing happened....but in my putty/sftp client i get the "Putty closed unexpectedly: connection refused" , i also change the port number from 22 to 2222 maybe i thought my ISP has it blocked (although it was running correctly when they installed the OS the first time) but still not able to connect or if i do it will be for a split second same for a friend i've asked to test this with me....so its not only me. oh and this is what i get when i run service sshd stats "openssh-daemon (pid 2810) is running..." thanks for your time. i couldn't upload them here so i will provide this link: http://www.uhirc.com/log.zip thanks again.

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: SSH/sftp client closes unexpectedly.

Post by pschaff » 2010/08/01 15:00:52

[quote]
lurk wrote:
yes i have included a screen shot of my iptables since i cant copy n paste.
[/quote]
Why is that? Text would be far preferable to images. The forum attachment function is permanently broken while awaiting the arrival of "Website 2.0".

Please do re-read [url=http://www.centos.org/modules/newbb/viewtopic.php?topic_id=14274&forum=47]Readme First[/url] and take a bit of care to format your posts. The run-on paragraphs are hard to read, and the combination of that with failure to spell correctly (s/cant/can't/), use complete words (s/n/and/), and capitalize appropriately (s/i/I/) seems sloppy and will cause many to just ignore your questions.

I am clueless as to what your problem may be. Usually ssh "just works" with little or no configuration. Can you ssh to "localhost"?

lurk
Posts: 6
Joined: 2010/07/31 10:22:43
Contact:

Re: SSH/sftp client closes unexpectedly.

Post by lurk » 2010/08/01 17:31:54

I am very sorry about the previous post and I am not very familiar with forum rules but thanks for the link.

[quote]
pschaff wrote:
Why is that? Text would be far preferable to images. The forum attachment function is permanently broken while awaiting the arrival of "Website 2.0".
[/quote]
I am not able to copy and paste with IPMI, I just can't simply find the option for it or the way to do it.

[quote]
pschaff wrote:
I am clueless as to what your problem may be. Usually ssh "just works" with little or no configuration. Can you ssh to "localhost"?
[/quote]
I thought so too this should work right out of the box but not in my case :-( the strangest thing is that i tried other OS as mentioned above and still the same problem, and yes I am able to SSH within IPMI console, but not externally (using winscp and putty). Thanks!

pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact:

Re: SSH/sftp client closes unexpectedly.

Post by pschaff » 2010/08/01 17:55:52

[quote]
lurk wrote:
...
I am not able to copy and paste with IPMI, I just can't simply find the option for it or the way to do it.
[/quote]
OK - I'm not familiar with the [url=http://en.wikipedia.org/wiki/Intelligent_Platform_Management_Interface]Intelligent Platform Management Interface[/url] so was not aware of such a limitation.

Hopefully someone else has a suggestion or question that will help find the source of the problem. I'm out of ideas.

lurk
Posts: 6
Joined: 2010/07/31 10:22:43
Contact:

Re: SSH/sftp client closes unexpectedly.

Post by lurk » 2010/08/02 03:00:44

Now that I really look at this, i'm having this gut feeling that maybe this might be related to IPMI. Although I have installed different operating systems and I have received the same problem with all of them only tells me it is something external from the OS and taken in consideration that ssh should work right out the box with minimal or no configuration the only really last thing I could point my finger to is that IPMI software.

Since I am able to login and work SSH without a problem within IPMI console I think maybe IPMI is blocking any external connection, then again it is just a thought. Any thoughts or suggestions are greatly appreaciated. :-)

lurk
Posts: 6
Joined: 2010/07/31 10:22:43
Contact:

[SOLVED] Re: SSH/sftp client closes unexpectedly.

Post by lurk » 2010/08/14 01:34:39

yes it was IPMI interferring with ports as soon as my hosting provider re installed IPMI it all went away. sorry for posting here.

Post Reply

Return to “CentOS 5 - X86_64,s390(x) and PowerPC Support”