Skip to main content
Solved

AutoLogin as root in High Sierra, Mojave

  • November 2, 2018
  • 11 replies
  • 9 views

mhasman
Forum|alt.badge.img+22
  • Valued Contributor
  • 426 replies

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!

Best answer by Hugonaut

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

11 replies

Hugonaut
Forum|alt.badge.img+15
  • Esteemed Contributor
  • 574 replies
  • Answer
  • November 5, 2018

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

mhasman
Forum|alt.badge.img+22
  • Author
  • Valued Contributor
  • 426 replies
  • November 5, 2018

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


Hugonaut
Forum|alt.badge.img+15
  • Esteemed Contributor
  • 574 replies
  • November 5, 2018

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


chrisdaggett
Forum|alt.badge.img+7
  • Valued Contributor
  • 94 replies
  • August 1, 2019

@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
Forum|alt.badge.img+22
  • Author
  • Valued Contributor
  • 426 replies
  • August 1, 2019

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


KyleEricson
Forum|alt.badge.img+17
  • Valued Contributor
  • 444 replies
  • August 1, 2019

@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

Forum|alt.badge.img+15
  • Valued Contributor
  • 78 replies
  • September 20, 2019

@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
Forum|alt.badge.img+9
  • Contributor
  • 30 replies
  • January 14, 2020

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


chrisdaggett
Forum|alt.badge.img+7
  • Valued Contributor
  • 94 replies
  • January 14, 2020

@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
Forum|alt.badge.img+17
  • Valued Contributor
  • 444 replies
  • January 14, 2020

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


mhasman
Forum|alt.badge.img+22
  • Author
  • Valued Contributor
  • 426 replies
  • January 14, 2020

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