Good question. Furthermore, if your answer is "because I forgot to log out", then the next question is: why are you using the root account when you don't need to?Originally Posted by brewbuck
Good question. Furthermore, if your answer is "because I forgot to log out", then the next question is: why are you using the root account when you don't need to?Originally Posted by brewbuck
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
@Anonymous: I really wasn't totally clear on what you wanted until post #8 (which I just now saw since I left work before you posted it). I think a lot of our confusion came from not understanding what exactly you wanted to do and perhaps more importantly, why. You're asking for what amounts to a very insecure and unorthodox solution to a simple problem -- a problem that has a much better solution than the one you want. To be a little blunt, you sound like you don't know Linux that well, and are looking for workarounds to your lack of administration skills. Everybody was a noob at some point, but it's important that you learn the right way to deal with these issues. Way back in the day (during the 2.0 kernel era), I learned quite a bit from O'Reilly's "Linux in a Nutshell" and "Linux System Administration". No idea how good the new editions are. They might help you out a great deal, or maybe somebody can recommend some other books or free online resources.
Basically you want to leave a root session open and logged on at all times. What's to stop your brother/girlfriend/friends from getting root access and disabling your "fail-safe"? And apart from the very obvious security issues there, you generally should not be logged in as root unless absolutely necessary. The root account should only be used for serious systems administration work, like installing new services, adding users, etc, when you need to perform numerous commands that require root privelages. If it's your system, only you should have the root password, nobody else. And if you need to do a quick task that requires root, like "yum install" or "apt-get install", set your regular user up in the sudoers file (man 5 sudoers), so you just type "sudo yum install".
Linux in runlevels 2, 3 and 5 (the "normal" ones) is a multi-user system. That means your brother, friends and girlfriend can all be logged on at the same time. If they are regular users of your system, give them a regular (non-root) user. You can just type "useradd my_ahole_brother_who_changes_my_root_password" and "useradd my_untrustworthy_girlfriend", and they'll have regular user accounts. You can also use whatever GUI version of this utility you may have. They will be able to browse the web or check their email, play games and maybe even do some programming, but they wont be able to change your root password. If you have friends who don't need to use your system regularly, maybe set up a guest account.