Como voltar o OS X para as telas iniciais de configuração

1

Acabei de vender meu Mac. No momento, estou reinstalando uma nova cópia do Lion. Depois disso, eu quero instalar a cópia do Office estou incluindo com ele e instalar todas as atualizações. Depois disso, é possível voltar atrás para que meu comprador receba as caixas de diálogo de configuração inicial "selecione uma língua, crie um usuário"?

    
por Amy 04.06.2012 / 19:50

2 respostas

1

Você pode fazer isso excluindo a conta de usuário criada por single-user mode .

Nota: substitua seu nome de usuário em todos os comandos que tenham a palavra username.

Depois de concluir a instalação do novo software e das atualizações, reinicie o computador enquanto segura Command-s .

Uma vez no prompt, digite o comando:

 mount -uw /

Remover preferências do usuário:

  rm -R /Library/Preferences/

Remover conta de usuário:

rm -R /Users/username/

Remover o AppleSetupDone:

rm /var/db/.AppleSetupDone

Em seguida, inicie os serviços de diretório digitando:

launchctl load /System/Library/LaunchDaemons/com.apple.DirectoryServices.plist
  • Note que você pode ter que usar com.apple.DirectoryServicesLocal.plist (mas tente o primeiro acima)

Agora, quais grupos de busca seu usuário pertence:

 dscl . -list /groups GroupMembership | grep username–

Remova os grupos correspondentes ao seu nome de usuário:

dscl . delete /groups/username
  • Faça isso para todos os grupos que você encontrou no comando acima

Remover banco de dados do usuário:

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

Depois que tudo for removido, digite reboot para reinicializar o sistema ou shutdown -h now para desativá-lo.

    
por 04.06.2012 / 20:04
0

De Como redefinir o Leopard para o Assistente de Configuração - Dicas do Mac OS X

This hint will probably be most useful for folks who configure machines for a living, but if you're selling or giving away your machine, or just troubleshooting login issues, it may come in handy. Here are the Terminal commands to delete a temporary (or lone) account in single-user mode on Leopard (in the following commands, replace username with whatever account short name you've created). Note that this must all be done in single user mode (hold Command-S during boot).

First, the usual stuff:

$ mount -uw /
$ rm -R /Library/Preferences/
$ rm -R /Users/username/

(Note that deleting /Library/Preferences/ is optional and in some cases may cause problems after pre-configuring some third-party software. However, I do this after simple configs or installs, e.g., install an OS, apply Software Updates, and then give it to the end user to create a fresh account.)

Now here's what's new in Leopard:

$ rm /var/db/dslocal/nodes/Default/users/username.plist
$ rm /var/db/.AppleSetupDone

While getting rid of .AppleSetupDone wasn't really necessary for OSes 10.2 thru 10.4, you do have to get rid of the Setup flag file in Leopard, or when you reboot, you'll get a login window and no working account to log in with.

I was hoping that I might be able to just type dscl . -delete /Users/temp to axe the account info (much shorter and easier to remember), but apparently the dscl command doesn't work in single-user mode even when you follow the instructional prompt to start Local Directory Services -- oh well.

BTW, trying to do all this through the GUI is pretty much impossible. Even if you enable Root and log in as that, the Accounts prefpane in Leopard won't let you delete the last or only Admin user account.

I also discovered something interesting: if you give your temporary account (or any Admin account) no password, you'll find that when you boot up and try to run sudo from a shell (bash at least), it won't work -- it just dumps back to the main user prompt. Solve this by giving your temporary account a short password, unless you're sure that you won't have to do any superuser shenanigans from Terminal as part of the config. A good security hedge for end users who don't like passwords, but still a new wrinkle to deal with.

    
por 04.06.2012 / 20:12