Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Twe Foju

macrumors 6502
Original poster
Dec 20, 2007
396
0
Jakarta
ok,so here's how it happened,

i just bought my MBP on 27 dec, around like a month ago

and you get this registration form at the beginning of the setup right? at that time, my MBP is still using 10.4.10 ( so basically it's tiger ) and i did the registration form ( its done and sent )

the next morning, i tried to install the Leopard which comes in the box, and after i did, the same setup was asked for us to fill it in right, ( the registration form stuffs ) but the internet was down at that time, so i thought i can cancel the registration form and do it when the internet backs up, because usually it can be located on our Home Folder, but then later, when the internet backs up, i wanted to do the form registration, but it's not there

so some of the expert on MBP asked me to perform this command in the terminal "sudo rm -f /var/db/.AppleSetupDone"

that command basically delete the history that we ever did the assistant register form and it took us back to the 1st setup, and it actually did, i was taken back to the welcome screen assistant right after i reboot, so it ends my curiosity at once

only to realize later on, does performing such task can cause any harm to my MBP? or like downgrade performance?

well, though there is no difference at performance task, ( still as fast as ever)
just curious does it totally save to perform that sudo task?

thanks

and finally, does anyone know how to re-appear the warning that appear on the 1st time we're about to use the Sudo command?

because now it's not appearing anymore, but i would love it to re-appear again, the warning, that is

anyone here know how to? i know it can, but there is no way i can know how to except the experts here =)

it will be greatly appreciated by me

thanks alot! :)
 
"sudo rm -f /var/db/.AppleSetupDone"

<SNIP>

only to realize later on, does performing such task can cause any harm to my MBP? or like downgrade performance?

Actually the task you ran was "rm" which basicially is the command line for delete (remove). All Sudo does is tell it to run as administrator (root user).

It won't do anything bad to your computer
 
ok, good to hear that

so how about the "how to make the warning re-appear" step?

does anyone know how to re-appear the sudo warning ?

i know it's not a big deal, because it sill ask us to type the password before the process,

but i would really love to see the warning again just to make it feels default-ish :D
 
Nope

Actually the task you ran was "rm" which basicially is the command line for delete (remove). All Sudo does is tell it to run as administrator (root user).

It won't do anything bad to your computer
As mentioned, the rm command is the same as pressing the delete button, or command backspace. The sudoing is only required for tasks which require an extreme ammount of authority to execute. Your computer will not be damaged, unless the command line purposefully damages it. As far as I know, only erasing and re-installing terminal (or returning it to factory settings will do the trick.
:)
 
hmm, ok, im relief now, because for a while, i thought i had messed up with my MBP system, pheww :D

i'll skip the re-installing part

how do i set it to factory default setting for the terminal?

:)
 
The warning about using the sudo command comes up essentially once per session for me, as in each time I restart or logout/in. After that, it assumes you read it the first time and doesn't bother displaying it again. Next time you restart, it'll be back the first time you try it.

jW
 
The warning about using the sudo command comes up essentially once per session for me, as in each time I restart or logout/in. After that, it assumes you read it the first time and doesn't bother displaying it again. Next time you restart, it'll be back the first time you try it.

jW

Mine doesn't do that. I use sudo at least once a day (syslogd runaway process) and after that first use, it has never bugged me again.
 
The warning about using the sudo command comes up essentially once per session for me, as in each time I restart or logout/in. After that, it assumes you read it the first time and doesn't bother displaying it again. Next time you restart, it'll be back the first time you try it.

jW
hm, mine does not do that, and im sure almost all of the terminal users wont find the warning the 2nd time they use sudo,

version update? im not sure, but i know the warning are meant to only show up once ( or if we did not use sudo command ) it will always appear

ill be waiting for an answer, hopefully

=)
 
sudo = su (switch user) and do (do it). It essentially just gives your current user root privileges to run a command that needs access to system files, or files owned by another user other then yours. Don't worry about it, just continue to use it when needed. :)
 
what does the -K does, if i might know? :)

does it delete any specific reference files or it is just a command to make the warning re-appear?

because im at college right now, i cant directly try it on my MBP since i left it at home

thanks :)
 
sudo -K is perfectly safe and won't mess anything up for you.

When you run the sudo command and authenticate with the administrative password, sudo timestamps it and allows you to run additional commands in the same terminal window for a few (maybe 5?) minutes without re-asking for the password. If you type 'sudo -k' lowercase it forgets that recent timestamp and requires you to provide your password again upon next usage. The 'sudo -K' command takes it one step further and erases any timestamps associated with your user. The result is the next time you try and use sudo, it can't find any previous timestamps so it assumes you have never run sudo before and issues the warning.

(Technically speaking, the "timestamp" is a directory entry in /var/db/sudo. The sudo -k command removes the directory associated with your short username.)
 
you mean in "/private/var/db/sudo/" ?

so which one is better?

using the sudo -K to remove the timestamp or remove the folder "/private/var/db/sudo/" ?
 
you mean in "/private/var/db/sudo/" ?

so which one is better?

using the sudo -K to remove the timestamp or remove the folder "/private/var/db/sudo/" ?

yes, sorry, /private/var/db/sudo/ and /var/db/sudo/ are one in the same (they are symbolically linked)

Practically speaking? six of one, half a dozen of the other on a Mac... it makes no difference. Theoretically speaking, you should use 'sudo -K' because it's implementation independent.. it will work on any platform that offers the sudo command, such as Linux, Solaris, *BSD, etc. For example, on my Linux box, the timestamp directory is /var/run/sudo instead. By using 'sudo -K' I wouldn't need to know or care. Removing the directory manually would be considered "tinkering under the hood."

Type 'man sudo' from a terminal window to learn more about the sudo command if you want to go down the rabbit hole. ;-) You can also type 'man rm' to learn about the rm command, etc.
 
The nuclear option:

cd /
sudo rm -Rf *

ahh yes, scorched earth.. not for the faint of heart..

370.jpg
 
ok, i typed "sudo -K" and nothing happened?

---edit---

ok, the warning shows up again, thanks alot guys!!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.