Saturday, December 16, 2006

Su and FreeBSD

Ok, I can't believe I forgot to tell you about my adventures with FreeBSD. The computer teacher at school dedicated a box for me to use with FreeBSD. Unfortunately, I have no classes with him; I have to go work during nutrition and lunch. And since it's winter break, I won't be making any progress on it anytime soon. You won't be hearing about it for at least three weeks.

So, to the point, something the absolutely wonderful FreeBSD Handbook didn't mention was using the "su" command. For those of you unaware of the special peculiarities of the UNIX operating system, su basically gives you privileges of the root user. The root user is the all-powerful user that can do anything on the computer. Typically, you use a limited user account (in BSD terms, "mere mortal"). This is a security feature. You won't be able to modify system files and accidentally do something stupid and mess up your computer (although, as I have demonstrated, "nothing is foolproof to a sufficiently talented fool"). Now, if you need to modify system files, you temporarily gain root privileges; this is done via the "su" command.

Now, when you first install FreeBSD, the computer is not programmed to give your account root privileges, you have to add yourself to something called "the wheel". Users in the wheel are allowed to use the "su" command and temporarily gain root privileges. By default, only the root user is in the wheel.

To add yourself to the wheel, you'll have to log in to the root account. This is done by putting "root" as the username, and the root password as the password (duh). Now, you'll have to edit a file in /etc/groups. For experienced UNIX command-line users, this can be done with vi, the command line text editor. For the rest of us, we can use the given "ee" (Easy Editor) editor or the "emacs" editor. I used "ee". After that, you'll see a line that starts with "wheel" and followed by "root". What you want to do, is put a comma, then your username. Save and exit and you're done. Now you can invoke root privileges with your user account. Give yourself a pat on the back, and try configuring X (I'm still working on it).

No comments: