Thank you for supporting the Cloud Customer Connect Community in 2024. It's a gift to work with you!

Look back
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: Duplicated Account Causes SSH to Fail With the "Permission denied" Error

edited Jan 2, 2024 12:39PM in Linux

APPLIES TO:

Oracle Cloud Infrastructure

Linux x86-6


SYMPTOMS:

When connecting to an Oracle Linux system via SSH, the below error is received:

$ ssh opc@example.com
opc@example.com: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
$ 


CAUSE:

The opc account is duplicated in the /etc/passwd file:

bash# grep opc /etc/passwd 
opc:x:0:0:opc:/opc:/bin/bash
opc:x:1000:1000:Oracle Public Cloud User:/home/opc:/bin/bash
bash# 

The above causes SSHd to fail with the below when executed in debug mode (via the /usr/sbin/sshd -d executed on server-side):

debug1: temporarily_use_uid: 0/0 (e=0/0) 
debug1: trying public key file /opc/.ssh/authorized_keys 
debug1: Could not open authorized keys '/opc/.ssh/authorized_keys': No such file or directory 
debug1: restore_uid: 0/0 

Howdy, Stranger!

Log In

To view full details, sign in.

Register

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