- Documentation
Elastic Compute Service
Elastic Compute Service
Troubleshooting
Remote log in issue
Linux operating system issue
Solution for missing system accounts in Linux instances
Linux operating system issue
Solution for missing system accounts in Linux instances
Solution for missing system accounts in Linux instances
This topic describes how to resolve login failures for a Linux instance caused by the loss of critical system user information. In a Linux system, if critical system user information (basic information and passwords) is lost, users may not be able to log in as expected. In such cases, it is necessary to restore the information in the /etc/passwd and /etc/shadow configuration files.
- The /etc/passwd file stores the basic information of all users in the system.
- The /etc/shadow file stores the password information of system users.
Prerequisites
Before you modify the configuration or data of an instance, we recommend that you create a snapshot to improve fault tolerance and ensure data security. Procedure
- Execute the following commands in sequence to back up the old etc/passwd and /etc/shadow files.
- Restore the /etc/passwd and /etc/shadow files.
tip
To obtain support when the methods described in this topic do not resolve your issue, submit a ticket. - If you back up your instance on a regular basis (/etc/passwd- and /etc/shadow- are backed up), you can execute the following command to restore the two files from the backups.
- Copy from other systems with the same configuration:
- If you have another instance with the same configuration and know the lost user information, you can restore the lost user information by copying the relevant content from the /etc/passwd and /etc/shadow files of that instance.
tip
This method may introduce other issues. For example, the UID and GID allocations may differ between the two systems. We recommend that you do not use this method.
- After the restoration is complete, restart the instance for the configuration to take effect.
Last updated: 2026.04.13 16:50:03