Don't like ads? PRO users don't see any ads ;-)
Guest

funkystuff

By: a guest on Jun 27th, 2012  |  syntax: None  |  size: 1.52 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. [root@lvm ~]# egrep "larry|curly|moe" /etc/sudoers
  2. larry   ALL = ALL
  3. curly   ALL = /sbin/, /usr/sbin/
  4. moe     ALL = (ALL) ALL
  5.  
  6. [root@lvm james]# su - larry
  7. [larry@lvm ~]$ sudo su -
  8. [root@lvm ~]# exit
  9. logout
  10. [larry@lvm ~]$ ps -u curly
  11.   PID TTY          TIME CMD
  12. [larry@lvm ~]$ ps -u curly
  13.   PID TTY          TIME CMD
  14.  6005 pts/3    00:00:00 bash
  15.  6039 pts/3    00:00:00 test
  16.  6040 pts/3    00:00:00 sleep
  17. [larry@lvm ~]$ sudo -u curly /bin/kill 6039
  18. Sorry, user larry is not allowed to execute '/bin/kill 6039' as curly on lvm.example.com.
  19. [larry@lvm ~]$ exit
  20. logout
  21. [root@lvm james]# su - moe
  22. [moe@lvm ~]$ sudo -u curly /bin/kill 6039
  23.  
  24. We trust you have received the usual lecture from the local System
  25. Administrator. It usually boils down to these three things:
  26.  
  27.     #1) Respect the privacy of others.
  28.     #2) Think before you type.
  29.     #3) With great power comes great responsibility.
  30.  
  31. [sudo] password for moe:
  32. [moe@lvm ~]$ exit
  33. logout
  34. [root@lvm james]# su - curly
  35. [curly@lvm ~]$ sudo -u moe /usr/sbin/useradd
  36.  
  37. We trust you have received the usual lecture from the local System
  38. Administrator. It usually boils down to these three things:
  39.  
  40.     #1) Respect the privacy of others.
  41.     #2) Think before you type.
  42.     #3) With great power comes great responsibility.
  43.  
  44. [sudo] password for curly:
  45. Sorry, user curly is not allowed to execute '/usr/sbin/useradd' as moe on lvm.example.com.
  46. [curly@lvm ~]$
  47.  
  48. [curly@lvm ~]$ sudo /usr/sbin/useradd
  49. [sudo] password for curly:
  50. Usage: useradd [options] LOGIN
  51.  
  52. Options: