Root as Primary Login: Why Not? 164
A user writes, "I help moderate a forum dealing with Mac OS X, and I'm having an awful time convincing a fair portion of our readers that logging in as root all the time is a Really Bad Idea. Worse, though, are the ones who try to convince others to log in as root all the time, claiming it's 'more Mac-OS-9-like,' or saying 'it's not really more insecure,' or even that 'a firewall should deter hackers pretty well.' I know all the standard arguments, but they're not working out. Does anyone here have some real-world anecdotes that I can point to?"
Re:Why i have to log in as root. (Score:3, Informative)
Re:Why i have to log in as root. (Score:5, Informative)
As for the original poster, I don't know what to say. In OS X root still has to give his password for authentication screens. The only convenience I can really see it having is to mess around with system libraries and configuration files unchecked. Oh yeah, thats right. Most unices aren't very vulnerable to virii because the user isn't root, so the virus can't get at the important things. The most a trojan could do is take out your home directory. Your system would still run.
Of course, logging in as root makes the system slightly more vulnerable to local attacks, but that isn't saying much.
Cmd-S during boot-up.
fsck -y
mount
SystemStarter
passwd root
System compromised.
But thats a feature. I think it can be disabled, possibly by supplying an OpenFirmware password... auto-logging in as root sort of ruins that, though.
If people want security similar to Windows, tell them to run as root. OS9 is somewhat more "secure" than OSX because it was meant to be stupid-proof. Running as root in OSX is like telling the computer you really know what you're doing. If you don't, you shouldn't.
Real world example....... (Score:2, Informative)
But that is my 2 cents, my advice would be to present your argument, if they don't want to listen and want to put their boxes at risk, let them. When they accidentally make a mistake bring their system down they will learn. If they don't learn from that and keep recommending bad admin practices to others, well they are morons. But that is another issue.
Re:Why i have to log in as root. (Score:4, Informative)
Yup, sure does. As far as I know, it's been there since forever. At least since 10.0.3, which was the earliest version that I used regularly.
Original Thread (Score:2, Informative)
There are a lot of threads at various mac forums with this topic, but a current one is here at MacNN forums [macnn.com].
MacNN forums seems to have a well deserved reputation for being full of idiots. Especially in the OS X threads.
Say hello to "Bobby" from Ventura California, who started this thread :)
Here's one. (Score:5, Informative)
chmod go-rwx ~/*
But by mistake, you hit the space bar, and get:
chmod go-rwx ~
By the time you realize the hard disk has churned too long, you'd just gone and wiped the permissions on
[pts/2@tardis:/home/dmorriso @00:45] chmod go-rwx ~
chmod:
chmod:
chmod:
chmod:
chmod:
chmod:
chmod:
chmod:
chmod:
chmod:
chmod:
chmod:
chmod:
chmod:
chmod:
[pts/2@tardis:/home/dmorriso @00:46]
And yes, back in the day, I did make this oops and had to reinstall, because I had used su rather than sudo, and had forgotten to un-su. I started using sudo right afterwards.
Re:You don't log in as root in macosx (Score:2, Informative)
You can enable root through the netinfo config utility. It asks for a new root password.
Re:Here's one. (Score:4, Informative)
I just want to second this. I did the same thing once, but on an SGI O2 rather than a Mac. My variation: chown -R foo
That was when I learned that you can't boot an SGI if files like
And yeah, it was easier and faster to just reinstall the OS than it was to try to fix the ownerships.
Necessary for GUI users? (Score:3, Informative)
However, most Mac users couldn't use a command line if their life depended on it and probably don't even know that MacOSX has a command line.
The MacOSX user who's a classic mac user will probably never use the command line; if they have to rename a thousand files to add an extension or a prefix or whatever, they'll do it by hand, not by using a tcsh script.
So, the question is, how much damage can one do from the MacOSX GUI at root? I don't know. I have accounts on other ppl's MacOSX computer (namely, at my University) but have never been logged in as root.
Of course, not logging in as root doesn't only protect you from yourself. It also protects you from "trogan" install programs, which say they'll do one thing, and in fact delete the entire hard drive or something else like that.
Re:You don't log in as root in macosx (Score:4, Informative)
You can enable root through the netinfo config utility. It asks for a new root password.
Partially correct. root is created on install just like any other Unix, and is the owner of most files on the system initially. Just who knows what the password is. Netinfo lets you set a different password, but all it is is a pretty GUI for "sudo su; passwd root".
Re:Here's one. (Score:2, Informative)
Dude, you're using the wrong shell:
NB: this is zsh figuring out my typo, not 'rm' being annoying.
Re:Here's one. (Score:3, Informative)
I don't have rpm installed, but I found a program that was only available as rpm. So I ran rpm2targz on it and then tar xvzf. It then extracted a whole bunch of files into a new usr folder in my current working directory, as I had forgotten to cd /. I was still root. So now to get rid of the directory I tried to type:
rm -r usr/
What I actually typed was this:
rm -r /usr
Oops!
Re:Why i have to log in as root. (Score:4, Informative)
OS X, like most unices, doesn't honor the set-uid bit for scripts.
I would just write a trivial C program and make that set-uid:
On OS X, install dev tools, compile as "cc file.c -o my-script" and then "chmod 4755 my-script". You can then run it from a normal user shell and the script is run as root (make sure the file is owned by root).
NB: I'm not replying directly to you, but rather to the original poster who wanted to know how to do this.
Re:Why i have to log in as root. (Score:2, Informative)
Nobody has yet replied to this point (subtle, this is easy to miss unless you've worked with people).
This is because adsl-connect is probably not in your PATH (I'm guessing it's in /sbin or /usr/sbin). You can do a 'man bash', hit the '/' key, type in PATH and keep typing 'n' until you find the entry in the manual page explaining how PATH works.
Short story: type in the following:
Make sure to type in the dash in the 'su' command. The second command should tell you exactly where adsl-connect is, and you can go from there.Re:Why i have to log in as root. (Score:3, Informative)
There are two big differences between "boxen" and "virii."
First of all, "boxen" is almost always tongue-in-cheek. It's an old joke, but it's just a joke.
Secondly, "boxen" would be correct, if it weren't for the simple fact that it isn't. It's just one of those quirks of the language: one box plus one box is boxes, and one fox plus one fox is foxes, but one ox plus one ox is oxen. Like a friend of mine said, about fifteen years ago, in my high school English class. "Drive, drove, have driven. Dive, dove, have diven?" "Boxen" is funny because its use points out the arbitrary and inconsistent nature of English pluralization.
As I said, though, "virii" isn't just technically wrong, it's completely wrong. Latin had either no plural at all for "virus," or only a very rarely used and easily confused plural, depending on whose interpretation you accept. "Virii" has zero basis in any kind of fact.
If the correct Latin plural of "virus" had been "virii," and if the use were intended to be sarcastic or humorous, I wouldn't mind so much. But the fact is, people often use "virii" in utter seriousness, as if it were correct and acceptable.
It isn't. It's wrong, wrong, wrong.
Re:Here's one. (Score:3, Informative)
Accuntability, least privilege, limiting impact (Score:2, Informative)
In my analysis, there are three reasons.
Re:stupid newbie question (Score:2, Informative)
Sudo lets you run commands as root without actually running your shell or whatnot under root - when the program is finished, so is your root access and you can't foof the system by accidentally doing rm -Rf / or something.
Why root? (Score:2, Informative)
z(p)