1

I have enabled SSH service on my Synology NAS and changed the port number as recommended in many articles online.

Until recently I was able to log into it without any issues but now (over the past couple of days) I keep getting the following error

user@MY-MBP ~ % ssh user1@xxx.xxx.x.xxx -p 163
kex_exchange_identification: read: Connection reset by peer

and Synology blocks my IP address.

I am trying to ssh into Synology from within my local (home) network.

I am not sure what has changed on the NAS. Could it be because I restarted the NAS while still connected (sshed) to the NAS?

How do I resolve this issue?

A j
  • 195
  • 1
  • 11
  • This StackOverflow thread might be helpful: (https://stackoverflow.com/questions/69394001/how-can-i-fix-kex-exchange-identification-read-connection-reset-by-peer) – Peregrino69 Feb 20 '23 at 11:19
  • thanks for the response. this did help, I will put the exact steps in an answer. – A j Feb 20 '23 at 16:59
  • Excellent! Do remember to accept the answer so this doesn't stay hanging as "Unanswered" :-) – Peregrino69 Feb 20 '23 at 17:32

2 Answers2

1

I had to edit the ~/.ssh/know_hosts file and remove the entries for my synology.

I restarted the NAS.

Then tried to connect and it will show up as if it is the first time your are connecting to the NAS via ssh.

user@MY-MBP ~ % ssh user1@xxx.xxx.x.xxx -p 163
The authenticity of host '[xxx.xxx.x.xxx]:163 ([xxx.xxx.x.xxx]:163)' can't be established.
ECDSA key fingerprint is SHA256:oH1mppmtt3aVMkJBUZrByxhUpelvmNQmvB4r9kvIo0Q.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '[xxx.xxx.x.xxx]:163' (ECDSA) to the list of known hosts.
user1@xxx.xxx.x.xxx's password: 
A j
  • 195
  • 1
  • 11
0

This is usually a sign that the SSH permissions for that user-account got messed up on the Syno side or on the client side (or both).

Best approach usually is on the client side to remove any saved SSH keys/credentials/keys.
And on the Syno side to remove SSH permission from the user-account, reboot the Syno, go to the home-folder of that user on the Syno and remove any SSH config/credentials/keys there. Then add the SSH permission back for that user.
That should provide the user-account with a fresh start regarding SSH.

Tonny
  • 29,601
  • 7
  • 52
  • 84