Performing Security Hardening on Ownerless Files

You can run the following command to search for files without owners in the system:

find / -nouser -o -nogroup

Then, create users and user groups based on the UIDs and GIDs of the files, or change the UIDs of existing users or GIDs of user groups to assign file owners, to prevent security risks caused by ownerless files.