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- Unable to ssh to instance with error "[FAILED] Failed to start Login Service"

APPLIES TO:

Oracle Cloud Infrastructure

Linux OS

SYMPTOMS

Console history shows below error :

[FAILED] Failed to start Login Service. See 'systemctl status systemd-logind.service' for details.

CHANGES

Oracle Linux 7 patching was performed

CAUSE

The files /etc/passwd, shadow, group, gshadow files were empty. But there was a backup

$ ls -l pass* gshadow* group* shadow* 
---------- 1 0 0     0     Jun 10 12:38 passwd  
---------- 1 0 0 10562 May 27 22:00 passwd- 
---------- 1 0 0    0    Jun 10 12:38 shadow 
---------- 1 0 0 3842 May 27 14:42 shadow-
---------- 1 0 0 0 Jun 10 12:38 group ---------- 1 0 0 3140 May 27 22:00 group- ---------- 1 0 0 0 Jun 10 12:38 gshadow ---------- 1 0 0 2962 May 27 22:00 gshadow-

SOLUTION

1) Boot the instance into maintenance mode following steps in document: To boot into maintenance mode

2) From the Bash shell, run the following command to load the SElinux policies to preserve the context of the files you are modifying:

Howdy, Stranger!

Log In

To view full details, sign in.

Register

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