SHARE
TWEET

Untitled

a guest Jun 17th, 2019 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. sudo: /etc/sudoers is owned by uid 501, should be 0
  2. sudo: no valid sudoers sources found, quitting
  3.      
  4. mount -uw /
  5. chown root:wheel /etc/sudoers
  6. chmod 440 /etc/sudoers
  7. reboot
  8.      
  9. # sudoers file.
  10. #
  11. # This file MUST be edited with the 'visudo' command as root.
  12. # Failure to use 'visudo' may result in syntax or file permission errors
  13. # that prevent sudo from running.
  14. #
  15. # See the sudoers man page for the details on how to write a sudoers file.
  16. #
  17.  
  18. # Host alias specification
  19.  
  20. # User alias specification
  21.  
  22. # Cmnd alias specification
  23.  
  24. # Defaults specification
  25. Defaults    env_reset
  26. Defaults    env_keep += "BLOCKSIZE"
  27. Defaults    env_keep += "COLORFGBG COLORTERM"
  28. Defaults    env_keep += "__CF_USER_TEXT_ENCODING"
  29. Defaults    env_keep += "CHARSET LANG LANGUAGE LC_ALL LC_COLLATE LC_CTYPE"
  30. Defaults    env_keep += "LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME"
  31. Defaults    env_keep += "LINES COLUMNS"
  32. Defaults    env_keep += "LSCOLORS"
  33. Defaults    env_keep += "SSH_AUTH_SOCK"
  34. Defaults    env_keep += "TZ"
  35. Defaults    env_keep += "DISPLAY XAUTHORIZATION XAUTHORITY"
  36. Defaults    env_keep += "EDITOR VISUAL"
  37. Defaults    env_keep += "HOME MAIL"
  38.  
  39. # Runas alias specification
  40.  
  41. # User privilege specification
  42. root    ALL=(ALL) ALL
  43. %admin  ALL=(ALL) ALL
  44.  
  45. # Uncomment to allow people in group wheel to run all commands
  46. # %wheel    ALL=(ALL) ALL
  47.  
  48. # Same thing without a password
  49. # %wheel    ALL=(ALL) NOPASSWD: ALL
  50.  
  51. # Samples
  52. # %users  ALL=/sbin/mount /cdrom,/sbin/umount /cdrom
  53. # %users  localhost=/sbin/shutdown -h now
  54.      
  55. machine:~ user$ ls /private/etc/sudoers
  56. -r--r-----  1 root  wheel  1275 13 Jun  2012 /private/etc/sudoers
  57.      
  58. /etc/sudoers
  59.      
  60. total 0
  61. drwxr-xr-x  2 501  0   68 Oct 23 23:56 yourusername
  62. drwx------  3 501  0  102 Nov 24 00:57 ts
  63.      
  64. total 0
  65. drwx--x--x   4 yourusername   wheel   136 Oct 23 23:56 .
  66. drwxr-xr-x  80 yourusername   wheel  2720 Nov 24 01:55 ..
  67. drwxr-xr-x   2 root  wheel    68 Oct 23 23:56 yourusername
  68. drwx------   3 root  wheel   102 Nov 24 00:57 ts
  69.      
  70. total 0
  71. drwx--x--x   4 root  wheel   136 Oct 23 23:56 .
  72. drwxr-xr-x  80 root  wheel  2720 Nov 24 01:55 ..
  73. drwxr-xr-x   2 root  wheel    68 Oct 23 23:56 yourusername
  74. drwx------   3 root  wheel   102 Nov 24 00:57 ts
  75.      
  76. total 0
  77. drwxr-xr-x  2 0  0   68 Oct 23 23:56 dan
  78. drwx------  3 0  0  102 Nov 24 00:57 ts
  79. UID is now set to 0 and not 501.
  80.      
  81. -r--r-----  1 501  0  1563 Nov 14 17:53 /private/etc/sudoers
  82.      
  83. -r--r-----  1 0  0  1563 Nov 14 17:53 /private/etc/sudoers
  84.      
  85. sudo su
  86. sudo chown -R root:wheel /var/db/sudo/ts/
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top