Slashdot Mirror


Root as Primary Login: Why Not?

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?"

56 of 164 comments (clear)

  1. Why i have to log in as root. by m_evanchik · · Score: 5, Interesting

    I'm a newbie and I always initially log in as root because that's the only way I can get adsl-connect going. I guess maybe I installed it as root, because it doesn't show up or run when I log-in as a regular user. Not a big deal but it is annoying to have to log in as root to get online and then to log out and log back in.

    1. Re:Why i have to log in as root. by brunson · · Score: 3, Informative

      If it needs root access to devices, which it almost certainly does to ifconfig an interface up, it should be installed suid root (if safe). Also, sudo is a great utility for doing things as root, does it come installed by default?

      --
      09F911029D74E35BD84156C5635688C0
      Jesus loves you, I think you suck
    2. Re:Why i have to log in as root. by lexarius · · Score: 5, Informative

      Well, you could have a script run at boot time to connect the adsl, or one that is set to run as root no matter who runs it.

      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.

    3. Re:Why i have to log in as root. by foobar104 · · Score: 4, Informative

      Also, sudo is a great utility for doing things as root, does it come installed by default?

      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.

    4. Re:Why i have to log in as root. by Permission+Denied · · Score: 4, Informative
      Well, you could have a script run at boot time to connect the adsl, or one that is set to run as root no matter who runs it.

      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:

      #include <unistd.h>

      #define ADSL "/path/to/adsl-connect"

      int main()
      {
      execl(ADSL, ADSL, NULL);
      return 1;
      }

      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.

    5. Re:Why i have to log in as root. by Permission+Denied · · Score: 2, Informative
      because it doesn't show up

      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:

      su -
      which adsl-connect
      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.
    6. Re:Why i have to log in as root. by foobar104 · · Score: 3, Informative

      You don't see anyone trying to eradicate the usage of "boxen" (even though "boxes" is the proper plural of "box").

      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.

  2. Not yet… by DarkVein · · Score: 3, Funny
    Does anyone here have some real-world anecdotes that I can point to?
    But I can make some what did you say their addresses were?
    --

    I'm as mimsy as the next borogove but your mome raths are completely outgrabe.

  3. Real world example....... by jsimon12 · · Score: 2, Informative

    My main reason for why you don't use root entirely is eventually no matter how careful you are you WILL make a mistake. Be it rm, chmod, mv, it will happen. If you use another account and try to do as much as you can as a none root user and only su up you will be less likely to simply careless do something.

    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.

    1. Re:Real world example....... by irony+nazi · · Score: 3, Insightful
      You miss a very important point.

      People who don't understand why you would/wouldn't log in as root are *extremely* unlikely to be playing around with 'rm', 'chmod', and 'mv'.

      You would have a better argument saying something to the effect of "dragging an important system file into the trash" or moving/renaming an important file/folder.

      I find it amazing how many people don't want to *login* to their computers.

      They tell me, "I know that it's safer to log into my computer, but it's such a pain." --to which my usual reply is "You don't know that it's safer to log in."

      --

      Bringing irony to the Slash-masses
  4. Live and learn by Dirty+Pickle · · Score: 2, Insightful

    I hate to say it, but they're going to have to get burned before they understand why they shouldn't log in as root all the time. Everyone I know has rm -rf'ed something important once, but just once.

    --


    this sig intentionally left blank
  5. Root is like crack by Anonymous Coward · · Score: 5, Funny

    Don't smoke it. I did once and got hooked. I ran Mac OS Updates as root. Fuck, I even had sex with my girlfriend as root. Man, that caused some permissions problems. When I started the road to recovery (logging in as Zacks) my girlfriend was all like: "Fuck no! You can't get any cause you don't own me an I don't go groups. You don't have the power to read, write OR execute so get out of my FACE" So I was all HELL NO bitch. And she wuz like you do not have root (superuser) privlages so get out of my TruBlueEnvironment! So then I went chown and chmodded her ass to me. Dat be-otch be up in my hizzouse. What what. Holla!

    1. Re:Root is like crack by Hard_Code · · Score: 2

      Nice try Seth Green.

      --

      It's 10 PM. Do you know if you're un-American?
  6. OS 9 like? Nope. by jasonwileymac.com · · Score: 5, Insightful

    "...claiming it's 'more Mac-OS-9-like,' "
    Nope. Not at all. OS 9 has the same level of protection for itself that OS X does, it just works a bit differently. Tell your friends to try this... In OS 9, drag your System Folder to the trash. Go on, do it. Whupps - you can't. Why? Because you don't have 'permission' to. You can only do it if you boot from a different source, like a CD or another volume. Unix does this far better than OS 9 could, but it's basically the same idea. Logging in as ROOT lets you do anything you want. Toss your kernel? SURE!!! No problem! BAD idea. I feel that if someone doesn't know why they shouldn't be root, that alone is reason enough for them NOT to be.

  7. Original Thread by owenc · · 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 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 :)

  8. Here's one. by Eagle7 · · Score: 5, Informative

    Let's say that you want to change the permissions of all the files in your home directory to go-rwx (which make sense). So, you type:

    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 /bin, /sbin, /var, etc. You're system is now screwed up to the point where it's probably faster to reinstall than change all the permissions. If you weren't root, you'd see something like this (from a Linux-PPC box):

    [pts/2@tardis:/home/dmorriso @00:45] chmod go-rwx ~ /*
    chmod: /bin: Operation not permitted
    chmod: /boot: Operation not permitted
    chmod: /dev: Operation not permitted
    chmod: /etc: Operation not permitted
    chmod: /home: Operation not permitted
    chmod: /lib: Operation not permitted
    chmod: /lost+found: Operation not permitted
    chmod: /mnt: Operation not permitted
    chmod: /opt: Operation not permitted
    chmod: /proc: Operation not permitted
    chmod: /root: Operation not permitted
    chmod: /sbin: Operation not permitted
    chmod: /tmp: Operation not permitted
    chmod: /usr: Operation not permitted
    chmod: /var: Operation not permitted
    [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. :)

    --
    _sig_ is away
    1. Re:Here's one. by foobar104 · · Score: 4, Informative

      chmod go-rwx ~ /*

      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 / when I meant to type chown -R foo .. The dot and the slash are just too damn close together for comfort.

      That was when I learned that you can't boot an SGI if files like /bin/sh and /sbin/init aren't owned by root.

      And yeah, it was easier and faster to just reinstall the OS than it was to try to fix the ownerships.

    2. Re:Here's one. by Eagle7 · · Score: 2

      D'oh - I forgot the -R in that example, which is the real kicker.

      --
      _sig_ is away
    3. Re:Here's one. by Permission+Denied · · Score: 2, Informative
      rm ugly-pron. *

      Dude, you're using the wrong shell:

      % ls
      good-pr0n1.jpg good-pr0n3.jpg good-pr0n6.jpg good-pr0n9.jpg
      good-pr0n10.jpg good-pr0n4.jpg good-pr0n7.jpg ugly-pr0n1.jpg
      good-pr0n2.jpg good-pr0n5.jpg good-pr0n8.jpg ugly-pr0n2.jpg
      % rm ugly-pr0n *
      zsh: sure you want to delete all the files in /home/pd/.pr0n [yn]? n
      rm: ugly-pr0n: No such file or directory
      % ls
      good-pr0n1.jpg good-pr0n3.jpg good-pr0n6.jpg good-pr0n9.jpg
      good-pr0n10.jpg good-pr0n4.jpg good-pr0n7.jpg ugly-pr0n1.jpg
      good-pr0n2.jpg good-pr0n5.jpg good-pr0n8.jpg ugly-pr0n2.jpg

      NB: this is zsh figuring out my typo, not 'rm' being annoying.

    4. Re:Here's one. by tunah · · Score: 3, Informative
      Mine was worse.

      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!

      --
      Free Java games for your phone: Tontie, Sokoban
    5. Re:Here's one. by Eagle7 · · Score: 3, Funny

      NB: this is zsh figuring out my typo, not 'rm' being annoying.

      You mean, that's zsh being annoying. :)

      --
      _sig_ is away
    6. Re:Here's one. by Eimi+Metamorphoumai · · Score: 3, Informative

      Ahhh, yes. Been there, done that. Of course, mine looked so innocent. Messing around in /proc, tried to make everything readable (to see how the proc virtual filesystem interacts with permissions). "chmod -R a+rwx *" Even made sure I was in the right place first. What I quickly (but not nearly quickly enough) learnt was that chmod -R follows symlinks, and that symlink to / made that command much less fun than it should have been. To this day, I loath commands that follow symlinks recursively (cp -r, chmod -R, I'm sure there are others), but I have gotten much better at "find -print0 | xargs -0".

      --

      Visit me on #weirdness on the Galaxynet.

  9. You don't log in as root in macosx by Bart+van+der+Ouderaa · · Score: 4, Interesting

    For the old unix hacker it looks like you're logging in as root, but that's not really the case. At install time the system creates two users, both have the same name and the same password!

    One is just a user, the other is root. In previous versions ( i haven't tested it lately) you could change the password of one but it wouldn't result in a password change of the other (which gave alot of headaches).

    Now if you log in you're the normal user, and you can't do anything really dangerous. You need su (which needs to be activated, it isn't possible by default) or sudo to do something as root. Also when you're doing an install that requires root the installer will ask for a super user.

    In both cases you use your own username and password (if your user is created at startup). So If somebody sneaks behind my computer when I'm gone to do something else, they can't really do anything dangerous. They would still need a password!

    You can make more users if you want without any rights (that's easy), but the system works better than it looks because you don't log in as root!

    You can if you want to btw. The password of root is the same as the password of the user.
    It does nail down the importance of good passwords which is something that alot of macusers are new to.

    1. Re:You don't log in as root in macosx by owenc · · Score: 2, Informative

      At install there is no root user created. So by default you cannot log in as root from the gui or via su. sudo is available however to users who are set as "admin".
      You can enable root through the netinfo config utility. It asks for a new root password.

    2. Re:You don't log in as root in macosx by Drakino · · Score: 4, Informative

      At install there is no root user created. So by default you cannot log in as root from the gui or via su. sudo is available however to users who are set as "admin".

      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".

    3. Re:You don't log in as root in macosx by Phroggy · · Score: 4, Insightful

      For the old unix hacker it looks like you're logging in as root, but that's not really the case. At install time the system creates two users, both have the same name and the same password!

      Um, no. This may have been true in pre-release versions, but in 10.0 and later, only your regular non-root account shows up in System Preferences. The root account doesn't have your name on it, and the encrypted password is set to "*" meaning logins are disabled altogether.

      One is just a user, the other is root. In previous versions ( i haven't tested it lately) you could change the password of one but it wouldn't result in a password change of the other (which gave alot of headaches).

      They are not the same account, so changing a user password will not change the root password, and vice-versa.

      Now if you log in you're the normal user, and you can't do anything really dangerous. You need su (which needs to be activated, it isn't possible by default) or sudo to do something as root. Also when you're doing an install that requires root the installer will ask for a super user.

      If you're an Administrator, you do have write access to the contents of /Applications and /Library, just not /System. The reason su doesn't work by default is, root doesn't have a password by default. However, any Administrator can run any command as root with sudo - for example, "sudo tcsh" will get you a root prompt.

      In both cases you use your own username and password (if your user is created at startup). So If somebody sneaks behind my computer when I'm gone to do something else, they can't really do anything dangerous. They would still need a password!

      If you're doing something that actually requires root privaleges, such as changing system settings or installing software, you must authenticate as an Administrator, even if you're already logged in as an Administrator. If you type "sudo tcsh", sudo will prompt you for your password. It's an excellent system.

      You can make more users if you want without any rights (that's easy), but the system works better than it looks because you don't log in as root!

      What?

      You can if you want to btw. The password of root is the same as the password of the user.

      As I said before, this is wrong. As I recall, the Public Beta set the root password to the same as the user password at install time; the final version didn't do this.

      If you do want to enable root logins, there are three ways to do it:

      A) open NetInfo Manager, click the padlock icon, authenticate, then go to select the Domain/Security/Enable Root User menu item

      B) open NetInfo Manager, click the padlock icon, authenticate, browse to /users/root, and change the value of the passwd item to an encrypted password

      C) open Terminal, type "sudo passwd", authenticate, and set a root password.

      It does nail down the importance of good passwords which is something that alot of macusers are new to.

      I set my system to automatically log me in at boot time, so it doesn't nail down anything.

      --
      $x='S24;r)>63/* h@<5+oZ)32"5cz';$me='phroggy'x$];
      $x=~y+ -xz+\0-Tx+;print$_^chop$me for split'',$x;
  10. Necessary for GUI users? by dh003i · · Score: 3, Informative

    As a command-line user, I understand the value of not logging in as root all the time.

    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.

    1. Re:Necessary for GUI users? by Phroggy · · Score: 2

      So, the question is, how much damage can one do from the MacOSX GUI at root?

      Muck around in /System and you can render the OS unbootable.

      --
      $x='S24;r)>63/* h@<5+oZ)32"5cz';$me='phroggy'x$];
      $x=~y+ -xz+\0-Tx+;print$_^chop$me for split'',$x;
  11. Mod this up by Spunkee · · Score: 2

    Mod this up. It's supposed to be funny. I don't see how it's a troll.

  12. The Mac OS X security story direct from Apple by plsuh · · Score: 5, Interesting
    First, my credentials: I'm a Curriculum Developer with Apple's WorldWide Training and Communications group. I am the author of the Network Security chapter in Apple's Network Administration course. I gave a talk at the last MacWorld on Mac OS X firewalling, and I must have done something right since they asked me to do it again in July in New York. In this post, unlike most of my other postings, I am speaking in my Apple voice.

    That said, Mac OS X has a root user, but root does not have a valid password on installation. The first user that is created via the setup assistant is what is known as an admin user. These are users who are members of the group "admin", a predefined group. Apple provides an API whereby a GUI application can ask for an admin user's password, and thus gain sudo-style privileges for actions such as installing software (which might need to put things in places that can only be touched by root). Also, the /Applications directory also is writable by admin users, so apps where the install is just drag and drop (such as OmniWeb or MSOffice) can also be installed by an admin user and do not require root privileges.

    In addition, admin users have access to the /Library directory, which is where resources specific to a particular machine should be stored. There are four Library locations that Mac OS X searches for resources such as fonts and frameworks:
    • ~/Library - for user-specific items
    • /Network/Library - for resources made available to an entire NetInfo network
    • /Library - for resources specific to a particular machine
    • /System/Library - the base system installation; this area is in general reserved for Apple use, and most people have no need to change anything inside here.

    Note that the /Library tree in general has ownership root:admin with privileges 775. This means that any admin user can add or remove resources from his or her own machine without resorting to using root directly. In fact, if you wanted to add a set of resources that would affect only a particular user (say, give only the graphic artist access to the full set of 300 fonts, and leave everyone else with just the usual system set of fonts), you could install them under the user's ~/Library directory. Because of the default search order, resources in ~/Library and /Library take precedence over those in /System/Library, so you can simply install a framework in /Library and override the OS's default behavior.

    If a user were to log in as root, he or she would immediately gain write access to the /System/Library area, which contains the really sensitive bits of the operating system. As it were on the warning labels, "No user serviceable parts inside!" Logging in as root is the equivalent of unscrewing the cover of a piece of equipment with that warning label. If you know what you're doing and you're careful, you may be able to do something in there, but if you're not careful or don't know what you're doing, you are likely to get hurt. I know of several users who had the bad habit of looking at a bunch of files in their System Folders and thinking, "I don't know what this does, I can just throw it out to gain more disk space," in older versions of the Mac OS. Turning one of these guys loose as root on Mac OS X is likely to cause major headaches.

    From the command line side of the house, admin users are allowed to do anything via the sudo command, which is preinstalled on Mac OS X. If you need root access, you can use sudo to do just about anything from the command line. If you really, really need a root shell, you can always do "sudo -s" and get one.

    In summary: Mac OS X has the tools that you need to perform system administration tasks form either the GUI side or the command line side without needing to log in as root. Logging in as root is the equivalent of opening up a piece of machinery with the warning label, "No user serviceable parts inside", and you should not be surprised if you get hurt when you do this.

    Paul Suh
    psuh@apple.dontbotherspammingmeigetwaytoomuch alrea dy.com

    Note: on Mac OS X Server, root is enabled by default. This is considered less of an issue since it is expected that servers will be run by people who have a better understanding of the issues involved and are more likely to be doing things that need root access, even from the GUI level.
    1. Re:The Mac OS X security story direct from Apple by Minupla · · Score: 2

      Logging in as root is the equivalent of opening up a piece of machinery with the warning label, "No user serviceable parts inside",
      ...and pouring in a bag of marbles
      ...and putting the machinery in a paint shaker :)

      Thanks for a lucid an enlightening post. It's going into my "I might need this to show a user someday" file.

      --
      On the whole, I find that I prefer Slashdot posts to twitter ones because I don't get limited to 140 chars before
  13. Not a new problem by Permission+Denied · · Score: 3, Insightful
    I knew this physics guy that bought a Linux box so he could do his Fortran numerical analysis on his own, without relying on the insanely big, fast and reliable physics servers (go figure). Smart physics guy, complete unix newbie.

    I'll only tell you the anectdote salient to this article. He would, of course, only log in as root as the KDE rpm front-end wouldn't work when you're logged in as a regular user and he didn't want to figure out how to use the the command-line rpm (I don't know if currently KDE does a sudo/su-type thing using the GUI, but it didn't back then - if you ran kfm as non-root, you couldn't use the RPM front-end).

    At one point he could no longer log in. Problem? / was full. He was downloading all his stuff into /root (a one gig partition) and /home (20 gig partition) was completely empty. You could log in from console, but not from XDM since XDM creates files in /tmp upon login. He had no idea how to get from XDM to another virtual console, so he was effectively locked out of his machine.

    My point? Give up. Don't worry about it. They will not learn why logging in as root is bad until they get burned. Especially since you're just a forum moderator - if you were getting paid to do this and your job depended on these machines staying up, you would have every responsibility to ensure people were properly following your policies; but, as a mere guru to these people, allow them to learn in the most effective fashion: trial by error.

    1. Re:Not a new problem by JabberWokky · · Score: 2
      (I don't know if currently KDE does a sudo/su-type thing using the GUI, but it didn't back then - if you ran kfm as non-root, you couldn't use the RPM front-end).

      Yes it does, and to give you an idea of how old your ancedote is, kfm was dropped in favor of Konqueror two major versions ago (since 2.x).

      --
      Evan

      --
      "$30 for the One True Ring. $10 each additional ring!" -- JRR "Bob" Tolkien
    2. Re:Not a new problem by JabberWokky · · Score: 2
      the anecdote is still relevant

      Didn't mean to imply that it wasn't relavant. I hold that *way* too many *nix apps break when they run out of disk space. Quite often in rather spectacular, data lossly ways, or in a quiet "I'll just throw this data away without ever alerting anybody" manner. Ditto for when the filesize exceeds the filesystem limit (less of a problem now, at least in Linux, but I hated that old damn 2GB limit).

      --
      Evan

      --
      "$30 for the One True Ring. $10 each additional ring!" -- JRR "Bob" Tolkien
    3. Re:Not a new problem by Mignon · · Score: 2
      Give up. Don't worry about it. They will not learn why logging in as root is bad until they get burned. Especially since you're just a forum moderator - if you were getting paid to do this and your job depended on these machines staying up, you would have every responsibility to ensure people were properly following your policies; but, as a mere guru to these people, allow them to learn in the most effective fashion: trial by error.

      I would add to this that you should reproduce for your readers some of the excellent advice already posted, but tell them to print out a hardcopy for themselves. Then, when they wreck their system, they can read what you posted and realize you were right.

  14. Re:OS 9 like? Nope. by WalterSobchak · · Score: 3, Insightful

    OS 9 like, sounds like "More Mac like", and logging in as root is not.
    My first Macintosh manual (for the Macintosh 512k) had the following to say about installing the "Programmer's Switch": "The Programmer's Switch is used to create an Interrupt or a Reset. If you do not know what an Interrupt or a Reset is, you do not need this switch". While people may criticize this, it has always been Apple's strategy to protect users from their own stupidity.
    So really to emphasize the parent post, "If you do not know why to log in as root, don't do it." Period. Nuff said

    Alex -- (And I don't even normally log into my BSD box as root)

    --
    Absinthe makes the heart grow fonder
  15. Re:All it takes is.... by __past__ · · Score: 2
    Do you want to say that "sudo rm -rf / tmp" is any better, or that one shouldn't try to clean /tmp? After all, you have to get root somehow to do such stuff.

    The problem is, IMHO, the mere existence of root, as opposed to a more fine-grained approach - things would be much nicer if "may bind to a port <1024" wouldn't automatically imply "may rf -rf /". It's nice to see that some unixes seem to move in this direction, but, well, HURRY THE F*CK UP, developers! ;)

  16. Re:My stupid story by tps12 · · Score: 2

    All you had to do was boot from a floppy or CD, mount your disk, and move the directory back. I have had to do this after toasting libc before.

    --

    Karma: Good (despite my invention of the Karma: sig)
  17. Aqua skin for slashdot? by Space · · Score: 2, Funny

    I realize this is slightly offtopic and I can probably kiss some karma points goodbye but, did anyone else notice a modified image at the top of this page? This image was at the top of this story.

    --
    I Don't Work Here
  18. Re:Don't bother by Van+Halen · · Score: 2
    alias 'rm' rm -i

    I hate it when some systems add this to the default .cshrc/bashrc/whateverc. IMO, relying on such an alias is asking for trouble. What happens if you're on another machine that doesn't have that aliased? What if the alias didn't take effect (something bad in your .cshrc caused it to stop parsing before that)? I've seen people use this alias to get into the habit of typing 'rm *' and just saying N to the files they wanted to keep. Bad idea.

    The intentions are good, but I think if you're playing with fire (doing things as root), you should be forced to be absolutely careful and type everything out just as you really meant it.

  19. It's funny... by gamgee5273 · · Score: 2
    Those of us who would be able to responsibly handle using root as our primary login don't.

    Those of us who might not be able to responsibly handle using root as our primary login want to.

    For the record, I have root enabled - but I rarely log in with it.

  20. wrong question... by teridon · · Score: 2

    The question should be, "Why do people who don't understand root access have it?"

    Perhaps you should lobby the companies these people work for to have their root (or admin) access removed :)

    --
    I hold it, that a little rebellion, now and then, is a good thing. -- Thomas Jefferson
  21. Have your grandmother try to read this thread... by frenchgates · · Score: 2, Insightful

    ...to understand why *nix is not ready for home user desktop prime time.

    --
    Syntax error: loose != lose, affect != effect, then!=than
  22. rm -rf /* by josepha48 · · Score: 2
    As a user with no privelidges and see what happens and then as root.

    After they have wiped out thier system ask them if they know how to install the OS ;-)

    Its sort of like NT do you give all your users admin priveledges or just the ones you trust?

    --

    Only 'flamers' flame!

  23. Run Root only when you need it Command line GUI by jellomizer · · Score: 2

    Not Running as root is a general safety factor in many aspects some that are stated and some that are not.

    1. Running as root is not forgiving of simple typo's rm ~ /* is a desasterous command. Also sometime I acedently click and drag a folder into an other folder. Doing this as root would alow me to move stuff that needs to be in its place to an other spot.

    2. Not running as root is one of the first line of defence from protecting yourself from Viruses and Trojans. If you dont have access to mess up your system good chances the file attachment you opened up will not have permission.
    3. Programming as non-root is good it could prevent you from accedently messing up important files Say you open("file","w") except for a open("file","r") and say file was /etc/passwd

    4. Stops you from making a mess of your file system. Say you were in /lib directory but you forgot about it and downloaded a file there. Then when you actually needed the file you cant find it so you have to run the find command. With a restriced access it allerts you that something is not right before you wast time.

    5. You know when you are doing something that may cause problems. If you cant do it as your own account then do an sudo to run it this makes you concious that you may be doing something that may damage the system so you will be more alert.

    6. Sometimes other people use your computer and they may not be as carefull as you.

    7. On multy user systems it may make people feel unconfortable if you use root all the time because they have no sience of privacy of there home directory. (This is a weak one but its true)

    8. It is a lot easier to crash the computer as root and running apps as root. You cant always trust other people code

    9. Loggin in as root all the time increases the chance that someone snooping your network will find the root password and create real damage.

    10. Some programs may give them selfs a lower (nice) level and eatup your system resourses.

    In generally running as root needs you be on on edge when ever you do something and the potential cost outwaigh the benefits

    --
    If something is so important that you feel the need to post it on the internet... It probably isn't that important.
  24. Re:Have your grandmother try to read this thread.. by Mignon · · Score: 2
    Have your grandmother try to read this thread... ...to understand why *nix is not ready for home user desktop prime time.

    Have her read at -1 to never speak to you again...

  25. Two good reasons together make ..... by Dimes · · Score: 3, Insightful

    ....an even more significant reason:

    1)As root you have the ability to not only do damage to your own user files...but you have the ability to damage/destroy the whole system. Being a user on a UnixOS is one of its beauties. No matter how bad you screw up as a user, its only your files...the system will still be there.

    2)OSX runs a number of Microsoft Applications....i.e. the Office Suite, and Outlook...which are notoriously prone to security problems.(albeit, quite a bit less on Mac)

    Mix those two reasons and you get something like Windows, where one script sent by email, clicked on by an /uneducated/ user(and sometimes not even clicked on...just received by something like Outlook) while logged in as root....and poof there goes the whole machine....lucky, at least for the rest of us cause at least that users box is gone.....or really unlucky for the net community at large if the virus/worm/et.al. keeps the machine and starts doing nasty self propagation.

    So, just dont do it. There is so little a regular user needs root for...and for that Apple has provided sudo....built in from the start.

    Dimes

  26. Accuntability, least privilege, limiting impact by Xenophon+Fenderson, · · Score: 2, Informative

    In my analysis, there are three reasons.

    1. To make individual administrators accountable for their actions by creating an audit trail. If multiple individuals use the "Administrator" or "root" account, the source of errors is obscured.
    2. To implement the principal of "least priviledge". Where possible, system access accounts will be assigned the least amount of priviledge possible (e.g. put a name service administrator into the "DNS Admins" group instead of "Enterprise Admins"). This may limit the degree of damage caused when a particular priviledged account is compromised, although it introduces communication complexity among system administrators and users.
    3. To limit the impact of accidents. By forcing administrators to use a non-priviledged account for regular tasks, the chances of accidentally damaging the network or any shared resources are reduced.
    --
    I'm proud of my Northern Tibetian Heritage
  27. Re:stupid newbie question by DaDigz · · Score: 2, Informative

    Nope.. You're logging in as an admin user - which is perfectly fine IMHO and much safer than running as root.

    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.

    --
    Those who will sacrifice Freedom and Security will get Windows...
  28. Why root? by zenasprime · · Score: 2, Informative

    I don't get it. Why do people feel the need to be root anyway? I have been an OS X user since Beta. I host my website on OS X and recently OS X server. I have configured Apache, BIND, Sendmail (ugh) and Postfix. I compile C++ source from the command line. If for some reason need to run a command as root (which can be frequent) i use sudo. There is a program called pseudo that will run apps as if they are root by drag/drop-ing files on top of it. If the user is an admin, they can config the system and install by simply providing their passwd. I have activated root from NetInfo to access certain functions but never once needed to log in as root. What is all the fuss is about?

    z(p)

  29. Re:Um, its the other way around... by crisco · · Score: 2
    Hmm, I think I see the point, and to a certain extent agree...

    :)

    --

    Bleh!

  30. why does everybody cite rm -rf? by WebMasterJoe · · Score: 2

    I understand that you can accidentally delete every file on your hard drive, but it's not as easy to accidentally do as so many people claim. You have to want to recursively delete all the files at a certain point in your directory tree - I personally never use rm -r and most people who don't understand the trouble with root wouldn't even know how to use the command. They're much less likely to type it in, and then even less likely to type it in when their pwd is '/'.

    I think that the classic example also downplays the dangers of typing in 'rm -rf ~/' - back when I did helpdesk work I had many more reports of people erasing their personal files than system files. It's much worse in my opinion to lose all your personal files than to lose important operating system files because they can't be replaced as easily (and these people almost never make backups). These were Windows 3.1 and 95 machines usually, so there was not much stopping them from deleting crucial files except their lack of knowledge. And all they would have had to type is "deltree c:\windows" or "del /y c:\windows\*.*" from any command prompt.

    So my point is that home users logging in as root is bad practice, but not likely to cause any problems that couldn't easily happen on most Windows systems (since XP creates passwordless administrator accounts by default I am including it in this category). If an OS X user (or desktop linux user for that matter) logs in as root all the time, and then one day royally screws up his/her system, he/she will probably be able to reinstall, or find somebody to reinstall, the system files that only root can destroy. The personal files, those which the user could have destroyed without root, will be deleted either way:

    Geek Friend: You really hosed your system this time! This wouldn't have happened if you logged in with your unprivileged account.
    User: So if I was logged in with my user account I wouldn't have been able to run 'rm -rf /*'? Odd that I typed in a command like that, which I don't even slightly understand...
    GF: Yep, that would have prevented it. Lucky for you I can reinstall your operating system and applications.
    U: How about all my important personal documents? Can you reinstall them?
    GF: Nope, they're hosed. Too bad you logged in as root.
    U: So if I logged in as myself those documents would still be safe??
    GF: Well, no. You'd be just as hosed, minus me spending two hours reinstalling everything else.
    So the lesson is: don't log in as root unless you know how to reinstall the OS.
    --
    I really hate signatures, but go to my website.
  31. OT: what a maroon! by Xtifr · · Score: 2

    So is "viri"/"virii" an old joke! I know that I first encountered it in the sixties, as a little kid. My mom used it -- and she was an English major and professional editor and writer. She was well aware that it was incorrect, but it tickled her sense of humor (as did some other malformed words and phrases, such as "swell foop", which she used more-or-less consistently throughout her lifetime).

    And how do you tell if people are using it "tongue-in-cheek"? When people use "boxen", they usually use it as if it were a real word, and don't draw any special attention to it. Pretty much the way they use "viri"/"virii". Unless you have previously unsuspected telepathic powers, you're using guesswork, and have no factual basis for your claim. Since I first encountered Tom C.'s humorless diatribe over a year ago, I have looked in vain for any evidence that anyone at all takes the silly misspelling seriously. I have failed to find any. It's a little more popular than "boxen", but then it seems to have spread through science fiction fandom, which was a little bigger and more widespread than hackerdom back in the sixties when all this silliness started.

    As for the ridiculous "it's not proper Latin" argument, well, that's just dumb! This is English we're talking about, not Latin. Hell, the word "television" mixes Latin and Greek roots, and by the measures you're applying, is a REAL abomination. Why don't you start a crusade to stamp out the word "television" instead of wasting your time on a mild (and admittedly not-very-funny) joke.

    1. Re:OT: what a maroon! by foobar104 · · Score: 2

      Why don't you start a crusade to stamp out the word "television" instead of wasting your time on a mild (and admittedly not-very-funny) joke.

      Because-- and I thought I made this perfectly clear-- "virii" was used in this context as a serious plural, with no sense of irony implied. That's not a joke. That's an error.

      Like I pointed out in my previous post, "boxen" as the plural of "box," like "VAXen" as the plural of "VAX," derives its certain humor from the irony of the English language itself. If itself, "boxen" is a sort of joke about English. There's no good reason why one ox plus one ox is oxen but one box plus one box is boxes. It's just one of those irregularities. In other words, if a person honestly didn't know the plural of "box" and guessed "boxen," it wouldn't be a dumb mistake.

      My circle of friends had a similar little joke in college: one deer plus one deer is two deer. Likewise, one beer plus one beer should be two beer. How many beer have you had tonight? I've had four beer. It was silly, but entertaining. Especially after four beer.

      "Virii," on the other hand, comes apparently from nowhere. There's no rational system of pluralization-- or even a decent precedent in irregular pluralization-- that would lead someone from "virus" to "virii." If you want you can say "viri," although that's confusing ("vir" was "man" in Latin, and "viri" was "men"). Or you can say "virora," in parallel with "corpus" and "corpora," but scholars think that's probably wrong, and besides it's really hard to pronounce correctly. (The accent would be on the first syllable: "VYE-ror-uh," like "COR-por-uh.")

      The bottom line is that "virii" is a made-up word. If you're going to play games with words, play by the rules. I don't care which set of rules you use, but play by some rules. There is no set of language rules-- from English, Greek, or Latin-- that would lead one to believe "virii" to be the plural of "virus."

      So using "virii" in any sense, ironic or otherwise, just makes you sound ignorant. Even worse, it makes you sound like you're an ignorant person who thinks they sound like an educated person.

    2. Re:OT: what a maroon! by Xtifr · · Score: 2

      Because-- and I thought I made this perfectly clear-- "virii" was used in this context as a serious plural, with no sense of irony implied.

      Which is irrelevent because -- and I thought I made this perfectly clear -- "boxen" is usually used as if it were a serious plural, with no obvious sense of irony implied. When I see "boxen" used, it's usually in simple statements, like, "I need to set up a dozen boxen tomorrow". I assume (because I know these are educated, intelligent people) that the people who write this know better, and are in on the joke, but I can't prove it, any more than you or I can prove that people who use "virii" do or don't know better.

      As for the fact that "virii" doesn't follow the rules of Latin, so freakin' what? That just means it's a different sort of joke! Personally, I fell off my chair laughing the first time I saw that spelling. But then, I'm not the sort of arrogant pinhead who assumes I'm smarter than everyone else (even though I usually am).

      And the fact that it's a made up word is irrelevent. English is full of made up words. And it's full of words (like "television") that don't follow the rules. "Correct" English is defined as what English-speaking people say/type. If enough people use "virii", it becomes correct, whether or not the rules of some long-dead other language justify it or not.

  32. i'm the user Pudge is talking about by gsfprez · · Score: 2

    and what led me to the question was the nth time i was unable, as the admin (the name put in at install time), i am often stopped at the gates when trying to read/write something to/from my wife's subdirectory /users/hotchick.

    One fateful night, i was, yet again, doing some printing for her (the printer's upstairs where my machine and the printer is) from her TiBook, and so i logged in as me on her TiBook to print her stuff...

    well, i couldn't get into her subdir... so i tried batchmod - and that doesn't (apparently) have a -R on it, so then i went to the CLI to

    sudo chmod -R 777 /users

    fine.

    the GUI STILL wouldn't let me into her subdir until i rebooted the Finder... damnit.

    then, later on that night, when she went to work on one of the files later, it turned out that when i had opened one up and made some changes for her, is changed the owner to adminboy - and hotchick couldn't open the files any more...

    arrrrgggh!!!! Its my fscking computer, and i want me or my wife to be able to read/write either/or's files to our heart's content. This includes ~/pictures (where things _have_ to be for iPhoto) and other "predetermined" subdirectories.

    i even went so far as to repartition the machine with a 18 gig primary drive, and a 2 gig hotchick_HD so that i could turn off file permissions..

    of course.. that check box doesn't ACTUALLY work - because not a day later - after the fresh install and all - all her stuff is on the 2 gig part - and when i maked some changes, she wasn't able to open those files later.

    so - if i have 2, and only 2, users on a machine that want to have separate logins (login-time differences, like desktops, Dock position, etc) but we want complete control of each other's files on the machine..

    i don't want it when i edit a Word file for her that it makes it "read only" when she logs in later to work on the file.

    so - that was, in a rage after the 100th time she came to me complaining that the computer wouldn't do what WE wanted it to do... in Pudge's conference..

    :FOR THE LOVE OF GOD, I"M JUST GOING TO LOGIN AS ROOT FOR NOW ON, DAMNIT!

    i didn't mean it.. but my quandry - non-system files being universally unprotected for all users to see and use - and how to get there in a very Mac OS 9-like way.... is still unresolved.

    --
    guns kill people like spoons make Rosie O'Donnell fat.