Advertisement
Guest User

Untitled

a guest
Aug 19th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.58 KB | None | 0 0
  1. [root@antergos tmp]# ls -l test
  2. -rwxr-xr-x 1 dolly users 16640 Aug 19 19:15 test
  3. [root@antergos tmp]# chown root:root test
  4. [root@antergos tmp]# chmod u+s test
  5. [root@antergos tmp]# ls -l test
  6. -rwsr-xr-x 1 root root 16640 Aug 19 19:15 test
  7. [root@antergos tmp]# ./test
  8. Real UID: 0
  9. Effective UID: 0
  10. [root@antergos tmp]# exit
  11. logout
  12. [dolly@antergos tmp]$ ./test
  13. Real UID: 1000
  14. Effective UID: 1000
  15. [dolly@antergos tmp]$ cat test.c
  16. #include <stdio.h>
  17. #include <unistd.h>
  18.  
  19. int main() {
  20.     printf("Real UID: %d\n", getuid());
  21.     printf("Effective UID: %d\n", geteuid());
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement