Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [root@antergos tmp]# ls -l test
- -rwxr-xr-x 1 dolly users 16640 Aug 19 19:15 test
- [root@antergos tmp]# chown root:root test
- [root@antergos tmp]# chmod u+s test
- [root@antergos tmp]# ls -l test
- -rwsr-xr-x 1 root root 16640 Aug 19 19:15 test
- [root@antergos tmp]# ./test
- Real UID: 0
- Effective UID: 0
- [root@antergos tmp]# exit
- logout
- [dolly@antergos tmp]$ ./test
- Real UID: 1000
- Effective UID: 1000
- [dolly@antergos tmp]$ cat test.c
- #include <stdio.h>
- #include <unistd.h>
- int main() {
- printf("Real UID: %d\n", getuid());
- printf("Effective UID: %d\n", geteuid());
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement