Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 04-28-2009, 07:41 AM   #1
LQ Newbie
Registered: Apr 2009
Posts: 13

Rep: Reputation: 0
Different SSH "Server unexpectedly closed network connection" (using Putty)

I know there have been numerous threads about this, but the fixes in those don't seem to be working. I have a server running OpenSuse 9.0, and I wanted to lock it down so in SSHD_Config I changed 'Allow root login' to 'No' then added a couple of users. However, whenever I try logging in with any of these users via Putty I get the above error message.

I've already changed UseDNS to 'No' and run the 'Touch /etc/environment' command, but still the problem persists. Interestingly, when I change 'Allow root login' back to 'Yes' that works fine logging on via Putty, so the problem must lie with the new users I have set up, but I'm not doing anything different to how I've set these users up on eight other OpenSuse 9.0 servers, and they all work fine with Putty ?
Old 04-30-2009, 08:22 AM   #2
LQ Newbie
Registered: Oct 2008
Location: Hyderabad
Posts: 26

Rep: Reputation: 15
Have you restarted the ssh server after changing root login to yes/no.For the changes to take effect we need to restart the ssh service
Old 05-29-2009, 04:00 AM   #3
LQ Newbie
Registered: Apr 2009
Posts: 13

Original Poster
Rep: Reputation: 0
Still not getting anywhere with this one,and it's now happening on six out of my nine OpenSuse 9 servers. I've checked the messages log and the error shown is

fatal: ssh_msg_send: write

has anyone seen this before ?
Old 07-22-2009, 06:10 AM   #4
LQ Newbie
Registered: Apr 2009
Posts: 13

Original Poster
Rep: Reputation: 0
Two months later..................

I've been trying various things to try and fix this without success, but have discovered one thing. If I change the setting in sshd.config to allow root login then logon via Putty using root it works fine. So this is only happening if I try and connect using normal user IDs. So I guess the problem is something to with permissions/allowing connections from standard user IDs ?
Old 07-22-2009, 07:23 AM   #5
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
Check the permissions of your ~/.ssh directory and of your private key.
Also check the permissions of your home directory.

Consider removing the rx permissions for the "users" group on your home directory. I use SuSE, and adding a group for myself and making this my default group is the first thing I do after installing. I think they do this to allow users to share folders in their home directories.

Also consider using public key authentication. In the sshd_config file, the commented paragraph above the "UsePAM Yes" line explains clearly which settings to change. In putty on your Windows machine, you can load in your key in their keygen program. The openssh compatible public key is displayed at the top. Copy the public key and add it to your ~/.ssh/authorized_keys file.

If you are doing all this remotely, don't change sshd_config until you have saved your public key in your ~/.ssh/authorized_keys file. And keep your first ssh session open, and test it by logging in again. That way, if it works, you can revert to the old sshd_config.

I would prefer using the regular ssh client of Cygwin/X if I were logging in from a Windows machine. That allows you to run GUI programs on the ssh server. YaST2 for example. The SuSE host doesn't need to be running in init level 5.

Last edited by jschiwal; 07-22-2009 at 07:30 AM.


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
Putty:server unexpectedly closed network connection dyool Ubuntu 8 03-07-2012 08:35 PM
SSH issue ""Server unexpectedly closed network connection" Errsta_Fonzarelli Linux - Software 12 05-24-2010 02:35 PM
rsync thru SSH --- connection unexpectedly closed shawn_t Linux - Networking 4 02-25-2005 02:27 PM
SSH PuTTy gives "connection refused" Sathington Linux - Networking 5 03-18-2004 05:10 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:31 AM.

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