- Learning Linux Shell Scripting
- Ganesh Naik
- 84字
- 2021-06-25 22:02:46
Setuid
Another very interesting functionality is the setuid feature. If the setuid bit is set for a script, then the script will always run with the owner's privileges, irrespective of which user is running the script. If the administrator wants to run a script written by him by other users, then he can set this bit.
Consider either of the following situations:
$ chmod u+s file_name $ chmod 4777 file
The file permissions after any of the preceding two commands will be drwsrwxrwx.