You may need to do this to prevent a bug with macOS High Sierra that enables login as root without a password even if the root user has not been enabled.
Click the Apple logo at the top left of your display and choose System Preferences from the menu that appears.
Select Users & Groups from the System Preferences window.
Click the Lock icon at the bottom left of the Users & Groups window.
Enter your administrative username and password, then click Unlock.
Click Login Options near the bottom left of the window.
Click the Join button.
Click the Open Directory Utility... button.
Click the Lock icon at the bottom left of the Directory Utility window.
Enter your administrative username and password then click the Modify Configuration button.
To enable the root user choose Edit from the menu bar at the top of the screen, then select Enable Root User.
If you have already enabled the root user but want to change the password, choose Change Root Password... from the Edit menu.
Enter a password for the root user then click OK.
Please follow iClarified on Twitter, Facebook, Google+, or RSS for more Apple news, videos, and tutorials.