Question: How to remove all the unnecessary user entries in /etc/shadow file.
1. Create a backup copy of /etc/shadow file.
# cp -p /etc/shadow /etc/shadow.backup
2. Ensure the user is not existing anymore in /etc/password file.
# cat /etc/passwd | grep [userid]
3. Edit the /etc/shadow file, look for the line and remove the unnecessary user entry.
# vi /etc/shadow
4. Ensure the user is not existing anymore in /etc/shadow file.
# cat /etc/shadow | grep [userid]