OCI- Unable to ssh to instance with error "[FAILED] Failed to start Login Service"
in Linux
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:
Tagged:
0