Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create user fails on macOS 10.13 - "Failed to authenticate with SystemAdministration framework." #32

Closed
americanhanko opened this issue Jan 25, 2018 · 2 comments

Comments

@americanhanko
Copy link
Collaborator

================================================================================
           Error executing action `create` on resource 'macos_user[create admin user randall and enable automatic login]'
           ================================================================================

           Mixlib::ShellOut::ShellCommandFailed
           ------------------------------------
           execute[add user randall] (/tmp/kitchen/cache/cookbooks/macos/resources/macos_user.rb line 48) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '255'
           ---- Begin output of ["/usr/sbin/sysadminctl", "-addUser", "randall", "", "-password", "correct-horse-battery-staple", "-admin"] ----
           STDOUT:
           STDERR: 2018-01-25 11:17:50.480 sysadminctl[880:5142] Failed to authenticate with SystemAdministration framework.
           ---- End output of ["/usr/sbin/sysadminctl", "-addUser", "randall", "", "-password", "correct-horse-battery-staple", "-admin"] ----
           Ran ["/usr/sbin/sysadminctl", "-addUser", "randall", "", "-password", "correct-horse-battery-staple", "-admin"] returned 255

           Resource Declaration:
           ---------------------
           # In /tmp/kitchen/cache/cookbooks/macos_test/recipes/new_users.rb

             1: macos_user 'create admin user randall and enable automatic login' do
             2:   username 'randall'
             3:   password 'correct-horse-battery-staple'
             4:   autologin true
             5:   admin true
             6: end
             7:
@americanhanko
Copy link
Collaborator Author

When running sysadminctl on 10.13, the admin user and password need to be passed to sysadminctl in addition to the -addUser options.

Changes to the sysadminctl command can be seen in the usage output on each OS:

macOS 10.12.6

Usage: sysadminctl
	-deleteUser <user name> [-secure || -keepHome]
	-newPassword <new password> -oldPassword <old password> [-passwordHint <password hint>]
	-resetPasswordFor <local user name> -newPassword <new password> [-passwordHint <password hint>]
	-addUser <user name> [-fullName <full name>] [-UID <user ID>] [-shell <path to shell>] [-password <user password>] [-hint <user hint>] [-home <full path to home>] [-admin] [-picture <full path to user image>]
	-guestAccount <on || off || status>
	-afpGuestAccess <on || off || status>
	-smbGuestAccess <on || off || status>

Pass '-' instead of password in commands above to request prompt.

macOS 10.13.2

Usage: sysadminctl [[interactive] || [-adminUser <admin user name> -adminPassword <admin user password>]]
	-deleteUser <user name> [-secure || -keepHome]
	-newPassword <new password> -oldPassword <old password> [-passwordHint <password hint>]
	-resetPasswordFor <local user name> -newPassword <new password> [-passwordHint <password hint>]
	-addUser <user name> [-fullName <full name>] [-UID <user ID>] [-shell <path to shell>] [-password <user password>] [-hint <user hint>] [-home <full path to home>] [-admin] [-picture <full path to user image>]
	-secureTokenStatus <user name>
	-secureTokenOn <user name> -password <password>
	-secureTokenOff <user name> -password <password>
	-guestAccount <on || off || status>
	-afpGuestAccess <on || off || status>
	-smbGuestAccess <on || off || status>
	-automaticTime <on || off || status>
	-filesystem status
Pass '-' instead of password in commands above to request prompt.

@americanhanko
Copy link
Collaborator Author

Resolved via #33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant