Build r50927 ssh root (Connection closed by ip port 22)

Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware
Author Message
iMAK
DD-WRT User


Joined: 06 Nov 2011
Posts: 81

PostPosted: Fri Dec 30, 2022 8:33    Post subject: Build r50927 ssh root (Connection closed by ip port 22) Reply with quote
I always update the firmware through ssh, currently I am on r50927 but can't access (ssh root@ip) in CMD and I get (Connection closed by ip port 22).

I haven't changed any settings in the router, Administration>Management>Router Management>SSH Management is enabled, Remote Port is 22.

Services>Secure Shell (SSH)>Enable Daemon> enabled, Port is 22.

I disabled the above and enabled them, rebooted the router but still.

Any help?

_________________
Buffalo WZR-HP-G300NH
Sponsor
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 2976
Location: Germany

PostPosted: Fri Dec 30, 2022 8:57    Post subject: Reply with quote
https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=333334&start=0


egc wrote:
P.S.
If you have trouble connecting with SSH then download the latest Putty and make sure under SSH/Host keys to move ed25519 to the top and untick "Prefer Algorithms for which a host key is known" or forget the HOST keys
If you have trouble connecting with WinSCP under Tools/Clean up Clear Cache



ho1Aetoo wrote:
So for me RSA and Ed25519 works without problems.
But I had to delete the router from known_hosts.

Ed25519 is now used as hostkey.

Server host key: ssh-ed25519

Code:
ssh-keygen -R 192.168.1.1
iMAK
DD-WRT User


Joined: 06 Nov 2011
Posts: 81

PostPosted: Fri Dec 30, 2022 9:38    Post subject: Reply with quote
I used Putty and it just worked, thanks for the tip.

I just entered the router ip and accepted the message and I could access the router through ssh, and upgraded the firmware.

But why I am not able to access through CMD as I used to before? Even in the latest build I can't.

_________________
Buffalo WZR-HP-G300NH
ho1Aetoo
DD-WRT Guru


Joined: 19 Feb 2019
Posts: 2976
Location: Germany

PostPosted: Fri Dec 30, 2022 9:57    Post subject: Reply with quote
In the posts I quoted everything is explained even how to delete the fingerprint when you use Linux CLI ssh

the post of egc refers to windows users
and my post refers to linux CLI users

To explain again.
Each ssh server sends a fingerprint, the fingerprint is stored by the clients (under linux in the ~/.ssh/known_hosts)
Since the router now uses a different hostkey, the fingerprint has changed and clients can't or don't want to connect anymore.

This can be fixed by deleting the stored fingerprint.

Instructions for Putty, WinSCP and Linux are above.

If you use something else then google is your friend.

as a small hint, the linux instructions also apply to Macs

https://kinsta.com/knowledgebase/warning-remote-host-identification-has-changed/
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14221
Location: Texas, USA

PostPosted: Sat Dec 31, 2022 2:54    Post subject: Reply with quote
https://dannyda.com/2020/08/17/how-to-delete-remove-permanently-added-ecdsa-key-fingerprint-from-windows-terminal-powershell-where-does-windows-terminal-powershell-save-ecdsa-key-fingerprint/

There's probably some command line voodoo that could be done to remove the old fingerprint or force the new one to be used, but.

_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
iMAK
DD-WRT User


Joined: 06 Nov 2011
Posts: 81

PostPosted: Sun Jan 01, 2023 12:03    Post subject: Reply with quote
kernel-panic69 wrote:
https://dannyda.com/2020/08/17/how-to-delete-remove-permanently-added-ecdsa-key-fingerprint-from-windows-terminal-powershell-where-does-windows-terminal-powershell-save-ecdsa-key-fingerprint/

There's probably some command line voodoo that could be done to remove the old fingerprint or force the new one to be used, but.

Thanks, this was a very quick fix.

_________________
Buffalo WZR-HP-G300NH
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum