Thread: Shell at login prompt

  1. #16
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Quote Originally Posted by brewbuck
    Also, why do they have root in the first place?
    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?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  2. #17
    Registered User
    Join Date
    Nov 2010
    Long Beach, CA
    @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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Own Shell: Displaying prompt and write a command
    By xyphen in forum C Programming
    Replies: 4
    Last Post: 12-08-2009, 04:21 PM
  2. Replies: 8
    Last Post: 12-08-2009, 12:55 PM
  3. Command Prompt Shell
    By FlyingIsFun1217 in forum C++ Programming
    Replies: 20
    Last Post: 09-19-2007, 02:36 PM
  4. Replies: 5
    Last Post: 05-06-2004, 09:14 AM
  5. Automatic Database login prompt
    By Colin in forum C++ Programming
    Replies: 1
    Last Post: 03-14-2003, 08:27 AM