Skip to main content
Solved

Root Account Enabled Extension Attribute

  • Sep 5, 2023 12:15 PM UTC
  • 4 replies
  • 119 views

AJPinto
Forum|alt.badge.img+26

Does anyone have a working Extension Attribute to read if the Root account is enabled? The one I was using does not appear to work anymore, and none of the commands I am seeing on the internet are working either.

 

This is what I was using.

 

 

#!/bin/bash rootCheck=$(dscl . read /Users/root | grep AuthenticationAuthority > /dev/null 2>&1 ; echo $?) if [ "${rootCheck}" == 1 ]; then echo "<result>Disabled</result>" else echo "<result>Enabled</result>"\\ fi

 

 

 

Best answer by mvu

The command below is from the CIS Ventura guide. Could you hash it up and re-fit for your EA?

Terminal Method:

Run the following command to verify the the root user has not been enabled:

 

$ /usr/bin/sudo /usr/bin/dscl . -read /Users/root AuthenticationAuthority
No such key: AuthenticationAuthority
View original

4 replies

mvu
Forum|alt.badge.img+25
  • Jamf Heroes
  • Answer
  • Sep 5, 2023 12:26 PM UTC

The command below is from the CIS Ventura guide. Could you hash it up and re-fit for your EA?

Terminal Method:

Run the following command to verify the the root user has not been enabled:

 

$ /usr/bin/sudo /usr/bin/dscl . -read /Users/root AuthenticationAuthority
No such key: AuthenticationAuthority

AJPinto
Forum|alt.badge.img+26
  • Author
  • Legendary Contributor
  • Sep 5, 2023 12:27 PM UTC

The command below is from the CIS Ventura guide. Could you hash it up and re-fit for your EA?

Terminal Method:

Run the following command to verify the the root user has not been enabled:

 

$ /usr/bin/sudo /usr/bin/dscl . -read /Users/root AuthenticationAuthority
No such key: AuthenticationAuthority

I did not think to check the CIS benchmarks, ill give that a try. thanks.


AJPinto
Forum|alt.badge.img+26
  • Author
  • Legendary Contributor
  • Sep 5, 2023 1:26 PM UTC

@mvu that got what I needed, thank you much. 

 

If anyone else needs it, here is the EA.

 

#!/bin/bash rootCheck=`/usr/bin/sudo /usr/bin/dscl . -read /Users/root AuthenticationAuthority` if [ "${rootCheck}" == dsenableroot ]; then echo "Disabled" exit 0 else echo "Enabled" fi

mvu
Forum|alt.badge.img+25
  • Jamf Heroes
  • Sep 5, 2023 1:42 PM UTC

Cool. Thanks for sharing your EA.