Salta al contenuto principale

Modello A1419 / EMC 2806 / Fine 2014 o metà 2015. Core i5 da 3,3 o 3,5 GHz o Core i7 da 4,0 GHz (ID iMac15,1); EMC 2834 fine 2015 / Core i5 da 3,3 o 3,5 GHz o Core i7 da 4,0 GHz (iMac17,1) Tutti con display Retina 5K.

573 Domande Visualizza tutte

How to remove AppleSetup Done on Mojave

Does anyone know how to remove AppleSetupDone on Mojave?

usually use this single user mode command:

/sbin/mount -uw /

rm var/db/dslocal/nodes/Default/users/admin.plist

rm -r /users/admin

rm var/db/.AppleSetupDone

reboot

Any ideas how to do this on Mojave would be much appreciated !

Risposto! Visualizza la risposta Anch'io ho questo problema

Questa è una buona domanda?

Punteggio 1
1 Commento

Does this still work with Catalina?

da

Aggiungi un commento

3 Risposte

Soluzione Prescelta

This is how I do it with the older MacOS versions How to Re-Run the OS X Setup Assistant. I haven’t tried it under Mojave yet, but I don’t think Apple has altered things.

Do keep in mind the only reason you would need to remove the empty .AppleSetupDone file is so the system thinks this is the first time setup was run.

Update (11/05/2018)

The first user account is by default the Admin account. But you can always create a new user account which has admin privileges. Or make guest or limited user accounts.

You can’t run a system without a admin account so deleting it is not wise. You can alter the user account permissions to add or remove access.

Questa risposta è stata utile?

Punteggio 1

1 Commento:

I need to remove an admin account.

Hence the admin.plist

Got any ideas how to do that?

da

Aggiungi un commento

I found this on Medium.com posted by Robert Hammen:

Similar to how iOS is configured, macOS is now on a separate partition from user data, which acts as if it is read-only (but in beta 1, it’s merely SIP-protected). In the beta, you’ll see “Macintosh HD” and “Macintosh HD — Data”. Data is a separate volume mounted in /System/Volumes. OS-installed applications live in /System/Applications, but the Finder presents them in /Applications as well. Apple calls the technology “firmlinking”. Beta 2 will be fully read-only by default.

Maybe this will help someone to update the commands required to remove a user folder and remove the .AppleSetupDone file (or whatever needs to be done to trigger the OOBE or new computer setup at startup.

Update (02/26/2023)

Just to update this thread - I've been doing the following commands for machines I'm going to sell:

Big Sur/Monterey (From Recovery Terminal, not Single User)
csrutil disable
rm /Volumes/Macintosh\ HD/var/db/.AppleSetupDone
rm /Volumes/Macintosh\ HD/Library/Keychains/apsd.keychain
rm -rf /Volumes/Macintosh\ HD/var/db/ConfigurationProfiles/
rm -rf /Volumes/Macintosh\ HD/Users/user
csrutil enable


Older
Reboot to Recovery (cmd.
-R)
Open Terminaln
csrutil disable
Reboot to Single User Mode (cmd-S)
/sbin/fsck -fy
/sbin/mount -uw /
[Catalina is /sbin/mount -uw /System/Volumes/Data]
sudo rm -rf /Users/user
/usr/bin/dscl . -delete "/Users/<username>"
sudo rm /var/db/.AppleSetupDone
sudo rm /Library/Keychains/apsd.keychain
sudo rm -rf /var/db/ConfigurationProfiles/
exit
cmd-Q to quit Welcome screen
Reboot to Recovery (cmd-R)
Open Terminal
csrutil enable
Quit Terminal
Shutdown



El Capitan
mount -uw /
cd /var/db/dslocal/nodes/Default/users/
rm test.plist
rm -rf /Users/test
rm /var/db/.AppleSetupDone
shutdown -h now


If anyone sees any errors or missing commands in any of the above, please correct this. I have seen these additional commands mentioned elsewhere but have never been able to get these commands to work (returns an error). Any ideas?
# dscl . -delete /Users/{username}
# dscl . -delete /Groups/admin GroupMembership {username}

Starting in macOS Ventura you can know factory reset your mac same as iOS. But that will remove any third party apps you might be wanting to preserve. FYI.


Thanks!

Questa risposta è stata utile?

Punteggio 1

2 Commenti:

/sbin/mount -uw /System/Volumes/Data is required for Catalina. I was not able to perform the /sbin/fsck -fy though - can't remember what error it gave but it did not appear to be successful.

da

@larry767 Thank you, I've missed this.

da

Aggiungi un commento

I guess just like Linux, you can simply switch to the directory and use the rm command.

Questa risposta è stata utile?

Punteggio 0
Aggiungi un commento

Aggiungi la tua risposta

P J sarà eternamente grato.
Visualizza Statistiche:

Ultime 24 Ore: 1

Ultimi 7 Giorni: 11

Ultimi 30 Giorni: 19

Tutti i Tempi: 11,593