-1

I've been connecting to my server via SSH for years. Always works fine.

Today I decided to change my password. After successfully changing the password, and then trying to connect again, I received the following error message:

ssh_exchange_identification: read: Connection reset by peer

I get this error from any laptop I try. However, I am able to SSH in via another box where the server is hosted, so I know that the password works and is correct.

I've done tons of googling, but I can't find an answer.

I believe this has something to do with RSA keys, and I think that I need to remove a key from my laptop or something, but I don't know how to do that.

Any help is greatly appreciated.

4
  • you need to look under .ssh in your user home directory
    – c4f4t0r
    Aug 17, 2014 at 19:03
  • Look for what? I'm a developer, not a sysops guy. I have absolutely no idea what any of this stuff even means. Aug 17, 2014 at 19:05
  • Is the server using fail2ban or something else, which may be breaking the connection?
    – kasperd
    Aug 17, 2014 at 19:15
  • I don't know what fail2ban is. Aug 17, 2014 at 19:27

1 Answer 1

1

On the boxes you are attempting to connect from, you need to cd into the .ssh folder in your home directory. Look for this file: known_hosts

If you delete that file the next time you attempt to contact a server it will ask you if you want to allow the connection.

You could also edit the file and you will see multiple keys (one for each server you connect to with ssh) -- delete the block that refers to the one with the problem connection from within that file. Unless you have a reason to do that, it is fine to delete the file.

9
  • Jeff, this certainly sounds like it could be the right thing. However I can't seem to find the known_hosts file on my Mac. I'm in the terminal window and I'm looking all over my home directory and I don't see it anywhere. I'm using ls -al and I can't even find a .ssh directory. Aug 17, 2014 at 19:23
  • I am using a mac that is okay. the '.' at the beginning of the .ssh directory name hides it from view. How you find it on a mac is like this: In Finder, at the top of the page is the Go menu item. The dropdown will have a 'Go to Folder' option. Click that choice and a box will appear. Put this into the box and hit enter: "~/.ssh" (without the quotes) Aug 17, 2014 at 19:25
  • Thanks. I found the file and cleared the entry. But I still have the same problem Aug 17, 2014 at 19:26
  • That is the required step, try: ssh username@ip_address and does it not let you? Aug 17, 2014 at 19:29
  • I tried with the ip address. Same result. Aug 17, 2014 at 19:30

You must log in to answer this question.

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