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

OCI- unable to SSH node with error Permission denied (publickey,gssapi-keyex,gssapi-with-mic)

Applies to:

Oracle Cloud Infrastructure

Linux OS 

Symptoms:

[root@xxxxxx ~]# ssh 172.X.X.X.X Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

Secure log :

sshd[9739]: Authentication refused: bad ownership or modes for directory /root
sshd[9921]: Authentication refused: bad ownership or modes for directory /root
sshd[10295]: Authentication refused: bad ownership or modes for directory /root
sshd[10384]: Authentication refused: bad ownership or modes for directory /root

Cause

$ ls -ld /root
drwxrwxrwx. 3 opc root 124 Feb  3 16:23 /root

Ownership and permission of /root is wrong.

Solution

Launch a Cloud Shell connection:

Boot the instance into maintenance mode: 

Troubleshooting Instances Using Instance Console Connections

Remount the root filesystem with Read-Write permission:

Howdy, Stranger!

Log In

To view full details, sign in.

Register

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