AutoLogin as root in High Sierra, Mojave

mhasman
Valued Contributor

Is it possible to do auto-login as root in High Sierra and/or Mojave - or that option is completely no more available?

Integrity protection is off, I am able to login as root. But in System Preferences - Users - Login Options the "Super Administrator" name is not available under Automatic login list.

Maybe some command line magic?

Thanks!

1 ACCEPTED SOLUTION

Hugonaut
Valued Contributor II

The following use to work - I think it's no longer a feature as of 10.13 (or 10.13.3 or 10.13.4 NOT POSITIVE) You must manually login to Root. If I am wrong, please correct me and let us know how you did it!

after enabling root with directory utility and then running these commands from root terminal... use to work..

sudo defaults write /Library/Preferences/com.apple.loginwindow autoLoginUser root
sudo defaults write /Library/Preferences/com.apple.loginwindow autoLoginUserUID 0
sudo shutdown -r now
________________
Looking for a Jamf Managed Service Provider? Look no further than Rocketman
________________


Virtual MacAdmins Monthly Meetup - First Friday, Every Month

View solution in original post

11 REPLIES 11

Hugonaut
Valued Contributor II

The following use to work - I think it's no longer a feature as of 10.13 (or 10.13.3 or 10.13.4 NOT POSITIVE) You must manually login to Root. If I am wrong, please correct me and let us know how you did it!

after enabling root with directory utility and then running these commands from root terminal... use to work..

sudo defaults write /Library/Preferences/com.apple.loginwindow autoLoginUser root
sudo defaults write /Library/Preferences/com.apple.loginwindow autoLoginUserUID 0
sudo shutdown -r now
________________
Looking for a Jamf Managed Service Provider? Look no further than Rocketman
________________


Virtual MacAdmins Monthly Meetup - First Friday, Every Month

mhasman
Valued Contributor

@Hugonaut Thank you Hugo - it works! Appreciate your help!

Hugonaut
Valued Contributor II

Great to hear, glad to help. I guess with integrity off it allows it, didnt work with integrity on (on mojave) for me!

________________
Looking for a Jamf Managed Service Provider? Look no further than Rocketman
________________


Virtual MacAdmins Monthly Meetup - First Friday, Every Month

chrisdaggett
Contributor II

@Hugonaut @mhasman Did you get that to work with Mojave? I was able to get it to work back with 10.13.3 but I havent been able to get it to work since. Tried SIP disabled, with or without a password for root. Doesnt auto login.

mhasman
Valued Contributor

I did not try it with Mojave yet. Maybe will try in 2-3 weeks

KyleEricson
Valued Contributor II

@chrisdaggett I have a workflow for AutoLogin not sure if it will work for root though.

Here are the steps I took:
(Works with 10.14.6)

  1. I used this tool to create a py script. MacUserGenerator
  2. Add the py script into a custom PKG with composer
  3. Create a kcpassword for this account https://github.com/xfreebird/kcpassword and add it to you custom PKG
  4. Add a post install script & kcpassword into the PKG.
  5. Done

Post Install Script:
(replace Administrator with your username)

#!/bin/sh

#Account Script
sudo chmod +x /tmp/admin.py
sudo python /tmp/admin.py

#Enable Autologin
sudo defaults write /Library/Preferences/com.apple.loginwindow.plist autoLoginUser -string Administrator

#Reboot Mac
sudo shutdown -r now

exit 0      ## Success
exit 1      ## Failure
Read My Blog: https://www.ericsontech.com

tep
Contributor II

@kericson I've used your workflow and autologin still doesn't work for me. Well, it works if i execute the workflow AFTER the user has logged in once. How is your policy triggers - ie is it part of a DEP workflow?

arnoldtaw
New Contributor III

@mhasman @Hugonaut @chrisdaggett @kericson Did you guys get that to work with Catalina?

chrisdaggett
Contributor II

@arnoldtaw Unfortunately not so far. Catalina is making things difficult on all accounts. (and just sucks in general IMO even administration aside... if I'm blunt).

KyleEricson
Valued Contributor II

@arnoldtaw I haven't tried this with Catalina. My results on this became more hit and miss so I moved away from it.

Read My Blog: https://www.ericsontech.com

mhasman
Valued Contributor

@arnoldtaw No, i did not succeed using root. So, instead of breaking macOS, I had to adopt another solutions