0

I am using putty to connect two ubuntu PC. One is OK but another one always has the error of remote side unexpectedly closed network connection. I have compared the SSH and raw data log between these two connections. Below is the difference between success and failed connection.

----successful message------

Incoming packet #0x3, type 6 / 0x06 (SSH2_MSG_SERVICE_ACCEPT)
  00000000  00 00 00 0c 73 73 68 2d 75 73 65 72 61 75 74 68  ....ssh-userauth
Outgoing packet #0x4, type 50 / 0x32 (SSH2_MSG_USERAUTH_REQUEST)
  00000000  00 00 00 04 72 6f 6f 74 00 00 00 0e 73 73 68 2d  ....root....ssh-
  00000010  63 6f 6e 6e 65 63 74 69 6f 6e 00 00 00 04 6e 6f  connection....no
  00000020  6e 65                                            ne
Outgoing raw data at 2019-06-06 10:51:13
  00000000  25 9a a1 ae cc ed c4 a5 7d e6 bc 7f ac be 9d 03  %.......}.......
  00000010  2b bd 85 35 c9 7d 60 66 c5 82 6a 45 12 19 55 ba  +..5.}`f..jE..U.
  00000020  7a 44 03 f9 12 00 f2 97 df 5e db 9e 36 ee 5f d8  zD.......^..6._.
  00000030  17 e8 54 15 19 36 ba 0f 48 8b eb 27 51 63 f8 00  ..T..6..H..'Qc..
  00000040  8f 91 b8 64 b1 0e 84 71 3e f1 0d 5e 16 0f f2 5b  ...d...q>..^...[
Incoming raw data at 2019-06-06 10:51:33
  00000000  a7 9b 40 c1 40 b8 4a 2e 8c c7 13 1e 9f 73 d4 bf  ..@[email protected]..
  00000010  b1 13 12 2d dc 85 b5 b1 c6 d1 f2 58 e7 b9 e3 9b  ...-.......X....
  00000020  36 e6 4f 5d 7e 9c e1 fe b1 04 45 14 2a 38 a8 88  6.O]~.....E.*8..
  00000030  28 51 e4 ff d3 d1 a5 14 9d 39 e1 46 72 d7 0b fa  (Q.......9.Fr...
  00000040  80 5d f7 f2 b2 f0 19 c2 d2 40 b0 70 84 03 f5 fe  .][email protected]....

-----failed------

Incoming packet #0x3, type 6 / 0x06 (SSH2_MSG_SERVICE_ACCEPT)
  00000000  00 00 00 0c 73 73 68 2d 75 73 65 72 61 75 74 68  ....ssh-userauth
Outgoing packet #0x4, type 50 / 0x32 (SSH2_MSG_USERAUTH_REQUEST)
  00000000  00 00 00 04 72 6f 6f 74 00 00 00 0e 73 73 68 2d  ....root....ssh-
  00000010  63 6f 6e 6e 65 63 74 69 6f 6e 00 00 00 04 6e 6f  connection....no
  00000020  6e 65                                            ne
Outgoing raw data at 2019-06-04 16:36:29
  00000000  7b 38 b6 ce 36 28 69 4f 59 6b 54 db 6a 7a 14 33  {8..6(iOYkT.jz.3
  00000010  d4 9f ef 42 c4 89 e3 ed 36 d7 10 c0 f8 e3 69 ec  ...B....6.....i.
  00000020  3a 2a 92 79 67 56 49 b6 7c 76 1e 2a e5 87 41 e3  :*.ygVI.|v.*..A.
  00000030  87 47 2e 74 77 aa 7c d9 45 99 8b b9 80 1a b0 66  .G.tw.|.E......f
  00000040  85 ca 0c a0 42 b7 9c 22 de 47 17 31 5f 28 1e 7e  ....B..".G.1_(.~
Event Log: Remote side unexpectedly closed network connection

Does anyone out there have any idea of it? Thanks in advance for all your help.

putty

2
  • Anything in the /etc/hosts.allow file on the inaccessible machine?
    – Jim L.
    Jun 7, 2019 at 22:30
  • all lines in the file are commented.
    – ChrisL
    Jun 10, 2019 at 2:17

1 Answer 1

0

Some reasonable checkpoints I could suggest:

  1. Are both ubuntu of same version?
  2. Are /etc/ssh/sshd_config files identical across them?
  3. Are putty session parameters the same?

UPD: My further guess

This must be something in the fact that your second copy is identical to the first. Before I elaborate my guess, Please try another round of the creating the images but this time please connect to the second copy first and then to the first one. My bet is - whichever you connect first right after creation is successful, while the next one fails.

Please do literally following:

1.

plink -v user@okhost     date > C:\some\path\okhost.log
plink -v user@failedhost date > C:\some\path\failedhost.log

2. share C:\some\path\okhost.log C:\some\path\failedhost.log as text ( http://hastebin.com for example )

I

15
  • I use ThinState to create an image on a USB drive. Then use that USB copy to replicate on another PC. Putty can access the original one without problem but the copy one failed. Therefore the Ubuntu version on two pcs are the same and both sshd_config files are identical as well as putty session parameters are the same.
    – ChrisL
    Jun 10, 2019 at 2:27
  • When you replicate the second image, do you keep the name of the instance the same? What do you use to connect to the images (same) hostname or IPs?
    – Tag Wint
    Jun 10, 2019 at 9:10
  • The Ubuntu is running in HP's ThinPro. I use ThinState to make an image. I just follow the steps to create the image in USB disk. There is no option to keep or not keep the instance name. I use IP address in putty to connect the Ubuntu.
    – ChrisL
    Jun 11, 2019 at 13:36
  • Pls see UPD. that you may try more.
    – Tag Wint
    Jun 11, 2019 at 15:32
  • Hi, Tag, I was busy on another project therefore late update. In fact, I have a master image of ubuntu. Any copy created from this master image can be putty. However, if I create another image from this copy then based on this second image to create another copy of ubuntu then cannot use putty to connect it. Seems it is a similar scenario described in your UPD. Do you know why that happens?
    – ChrisL
    Jun 22, 2019 at 10:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .