Nick Sephton
Nick Sephton

Reputation: 101

Oracle Cloud: Permission denied (publickey,gssapi-keyex,gssapi-with-mic)

I created an new Oracle cloud Linux instance, downloaded the private and public keys on creation, and now I cannot access it. I followed the guides and searched around, but I can mostly just find people who got their keys mixed up, which I have double-checked.

It shows as running, but if I try to SSH by doing:

ssh -i ssh-key-2022-09-18.key [email protected]

Then I get:

Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

Any help?

Upvotes: 3

Views: 8708

Answers (2)

Liliana
Liliana

Reputation: 1

For me the problem was the permissions of the private key file, when uploading via the cloud shell console, it gets set automatically to 644, had to set them to 400 for it to work. Also, it doesn't work if I try ssh opc@public_ip_of_opc_instance, works only via ssh -i private_key_file.key opc@public_ip_of_opc_instance.

Upvotes: 0

Ameen Ali Shaikh
Ameen Ali Shaikh

Reputation: 429

If you have used the OCI auto generated keys during Instance Creation then the default username is opc and not ops as mentioned in your question.

You will only be able to connect via SSH only if the keys are not misplaced as there is no way to retrieve the private key after the instance is created.

In case you have misplaced the keys then to upload new keys you will have to work with the boot volume (refer this answer How do you change the public key of a Oracle Cloud Instance? for more details on how to add new SSH key)

Note: To access OCI Instance, there are many other prerequisites like having public IP or accessing via bastion, etc. Please review this https://docs.oracle.com/en-us/iaas/Content/Compute/Tasks/accessinginstance.htm document for more details.

Upvotes: 5

Related Questions