OCI: ssh Fails with "kex_exchange_identification: read: Connection reset by peer" — Cloud Customer Connect
You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register
Note!! Please register for a free account to access the full content and also to participate in Q&A in the community

OCI: ssh Fails with "kex_exchange_identification: read: Connection reset by peer"

edited Jun 30, 2025 10:27AM in Linux

Note!! Please register a free account to access the full content and also to participate in Q&A in the community

Applies to:

Oracle Cloud Infrastructure - Version N/A and later
Linux x86-64

Symptoms
When attempting to ssh into and instance, the following message is displayed:


kex_exchange_identification: read: Connection reset by peer
Connection reset by 10.x.x.x port 22

Cause
Incorrect permission on /var/empty/sshd

$ sudo ls -ld /var/empty/sshd
drwxrwxrwx. 2 root root 6 Aug 14 2024 /var/empty/sshd

Solution
Permission should be 711 on the /var/empty/sshd

  1. Change the permission as follows:
    $ sudo chmod 711 /var/empty/sshd

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!