Unable to delete built in user #181

Closed
opened 2025-12-29 00:19:44 +01:00 by adam · 3 comments
Owner

Originally created by @aaronnewsome on GitHub (Apr 30, 2021).

Amazing project here. Thanks for all the hard work. I started a docker container using

sickcodes/docker-osx:auto

That all worked fine. I was able to create a new user account, networking works, etc. I was even able to commit those changes to a new image with docker commit. However, after creating my own user account in mac os, I no longer need the "user" account.

Logging in as myself and attempting to delete the account "user", just crashes the container immediately. There's no error message or other indications of why the crash occurred.

Any ideas what causes this or how to delete the user account?

Originally created by @aaronnewsome on GitHub (Apr 30, 2021). Amazing project here. Thanks for all the hard work. I started a docker container using sickcodes/docker-osx:auto That all worked fine. I was able to create a new user account, networking works, etc. I was even able to commit those changes to a new image with docker commit. However, after creating my own user account in mac os, I no longer need the "user" account. Logging in as myself and attempting to delete the account "user", just crashes the container immediately. There's no error message or other indications of why the crash occurred. Any ideas what causes this or how to delete the user account?
adam added the documentationhelp wanted labels 2025-12-29 00:19:44 +01:00
adam closed this issue 2025-12-29 00:19:44 +01:00
Author
Owner

@sickcodes commented on GitHub (May 2, 2021):

boot it using :naked or create another one via docker-osx:latest if you want Catalina, or docker-osx:big-sur if you want Big Sur.

I didn't expect anyone to create another account on auto so I would have to add a command, for booting into an alternate user.

In any case, just follow the README to pull the image out and boot with another user: https://github.com/sickcodes/Docker-OSX#container-creation-examples

Or simply leave that user there.

@sickcodes commented on GitHub (May 2, 2021): boot it using `:naked` or create another one via `docker-osx:latest` if you want Catalina, or `docker-osx:big-sur` if you want Big Sur. I didn't expect anyone to create another account on auto so I would have to add a command, for booting into an alternate user. In any case, just follow the README to pull the image out and boot with another user: https://github.com/sickcodes/Docker-OSX#container-creation-examples Or simply leave that user there.
Author
Owner

@sickcodes commented on GitHub (May 28, 2021):

OLD_USER=user
NEW_USER=steve
NEW_PASSWORD=xxxxxxx

# make yourself an admin
sudo tee -a "/etc/sudoers.d/${NEW_USER}" <<< "${NEW_USER}     ALL=(ALL)       NOPASSWD: ALL"

# add a new user
sysadminctl -addUser \
    -addUser "${NEW_USER}" \
    -shell /bin/bash \
    -password "${NEW_PASSWORD}" \
    -home "/Users/${NEW_USER}"

# create new home
mkdir -p "/Users/${NEW_USER}"

# chown new home
chown -R "${NEW_USER}" "/Users/${NEW_USER}"


# delete the old one
sudo sysadminctl -deleteUser "${OLD_USER}" -secure

@sickcodes commented on GitHub (May 28, 2021): ```bash OLD_USER=user NEW_USER=steve NEW_PASSWORD=xxxxxxx # make yourself an admin sudo tee -a "/etc/sudoers.d/${NEW_USER}" <<< "${NEW_USER} ALL=(ALL) NOPASSWD: ALL" # add a new user sysadminctl -addUser \ -addUser "${NEW_USER}" \ -shell /bin/bash \ -password "${NEW_PASSWORD}" \ -home "/Users/${NEW_USER}" # create new home mkdir -p "/Users/${NEW_USER}" # chown new home chown -R "${NEW_USER}" "/Users/${NEW_USER}" # delete the old one sudo sysadminctl -deleteUser "${OLD_USER}" -secure ```
Author
Owner

@sickcodes commented on GitHub (Aug 2, 2021):

Lots of optimizations added here: https://github.com/sickcodes/osx-optimizer

@sickcodes commented on GitHub (Aug 2, 2021): Lots of optimizations added here: https://github.com/sickcodes/osx-optimizer
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Docker-OSX#181