You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

76 lines
1.4 KiB

  1. #!/bin/bash
  2. ###############
  3. # /root stuff #
  4. ###############
  5. echo
  6. echo "-------------[ /root permissions ]------------------"
  7. root_permission=$(stat /root | grep -c "Access: (0700/drwx------)")
  8. if [ "$root_permission" -ne 1 ]
  9. then
  10. echo "WARNING: The permissions on /root are NOT 0700"
  11. else
  12. echo "info: The permissions on /root are normal"
  13. fi
  14. echo
  15. echo -e "Here's what's in /root: \n"
  16. find /root -type f -perm -o=r -printf "%m \t %P \n"
  17. echo
  18. find /root -type f -not -gid 0 -not -uid 0 -printf "%m \t %u:%g \t %P \n"
  19. ###############
  20. # sudo users #
  21. ###############
  22. echo
  23. echo "-------------[ sudo users ]------------------"
  24. #enter users you expect to be in this group
  25. #delimit this as so: user1,user2,user3
  26. expected=""
  27. sudo_users=$(cat /etc/group | grep "sudo" | cut -d: -f4-)
  28. if [ "$sudo_users" == "$expected" ]
  29. then
  30. echo "info: Sudo users as expected: $sudo_users"
  31. else
  32. echo "info: Unexpected user in sudo users: $sudo_users"
  33. fi
  34. echo
  35. ################
  36. # docker users #
  37. ################
  38. echo
  39. echo "-------------[ docker users ]------------------"
  40. #enter users you expect to be in this group
  41. #delimit this as so: user1,user2,user3
  42. expected=""
  43. docker_users=$(cat /etc/group | grep "docker" | cut -d: -f4-)
  44. if [ "$docker_users" == "$expected" ]
  45. then
  46. echo "info: Docker users as expected: $docker_users"
  47. else
  48. echo "info: Unexpected user in Docker users: $docker_users"
  49. fi
  50. echo