Actual User (group) ID:
Identifies who the user is, and the two fields are taken from the login entry in the password file when they log on.
Valid user (group) ID:
Determines access to the file, usually valid user (group) ID equals the actual user (group) ID, who runs the valid ID equals who's actual ID, regardless of the owner of the file.
If the set User (group) ID bit is set, then the valid user (group) ID is equal to the owner (group) ID of the file, and the valid ID is related to the file owner ID.
For example:/usr/bin/password, the program needs to write the password file, but the password file only Superuser has write permissions, so you need to set the user ID bit,
Then when the ordinary user executes passwd, the valid user ID equals the ID of the file owner root, and has the permission to write the password file;
Linux actual user (group) ID, valid user (group) ID, set User (group) ID