The file permissions bits include an execute permission bit for file owner, group and other. When the execute bit for the owner is set to "s" the set user ID bit is set. This causes any persons or processes that run the file to have access to system resources as though they are the owner of the file. When the execute bit for the group is set to "s", the set group ID bit is set and the user running the program is given access based on access permission for the group the file belongs to. The following command:
chmod +s myfile
sets the user ID bit on the file "myfile". The command:
chmod g+s myfile
sets the group ID bit on the file "myfile".
Hopefully this is of some use, I've never used the s flag for permissions, so I don't have any personal experience with it.
From what I can tell, this would give you the permissions you seek:
chmod 711 file
chmod u+s file
chmod g+s file
There's probably a way to do it in fewer commands, but like I said I have no experience with the "s" permission flag.