How to set the setuid and setgid bit for files in Linux

The concept of setuid means anybody executing the file will inherit the permissions of the owner of the file.

chmod 4555   filename
The concept of setgid means the process will be executed under the group of the file although you are not in the dedicated group.
chmod 2555   filename

*Very careful in utilizing this feature as it will cause security problem
*in your server

More info on setuid and setgid can be found HERE