OCI: SSH Fails with Error "identity_sign: private key /root/.ssh/id_rsa contents do not match public — 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 Error "identity_sign: private key /root/.ssh/id_rsa contents do not match public

APPLIES TO:
Oracle Cloud Infrastructure
Linux OS

SYMPTOMS

ssh fails with the following error:

# ssh <HOSTNAME> 
identity_sign: private key /root/.ssh/id_rsa contents do not match public
root@<HOSTNAME>: Permission denied (publickey).

CAUSE

The private key at the client and the public key at the server does not match.

SOLUTION

  1. Create a new ssh key pair from the client
    # ssh-keygen -b 2048 -t rsa
  2. Copy the newly created public key to the server
    # ssh-copy-id root@<HOSTNAME>
  3. Try to ssh to the remote server

Howdy, Stranger!

Log In

To view full details, sign in.

Register

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