How to login as ROOT
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 15 of 15
  1. #1
    Join Date
    Nov 2008
    Location
    Kansas City (cowtown USA)
    Posts
    75
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to login as ROOT

    As I have seen this asked, and I had the time to do the research.

    WARNING! These examples may crash your computer if not executed properly.

    It is recommended that you always login as normal user to avoid any damage to your system and then use su - to get root level access as required.
    PLEASE, USE WITH CAUTION

    Log in as normal user

    Then open GUI terminal (bash prompt) and type the following command to become root user:
    Code:
    $ su -
    Type your root password. Next, make a backup of /etc/pam.d/gdm, enter:
    Code:
    cp /etc/pam.d/gdm /root
    Now open /etc/pam.d/gdm using gedit or vi text editor, enter:
    Code:
    gedit /etc/pam.d/gdm
    OR
    Code:
    vi /etc/pam.d/gdm
    Alternatively, you can do everything in a one command:
    Code:
    su -c 'gedit /etc/pam.d/gdm'
    Find line that read as follows:
    Code:
    auth required pam_succeed_if.so user != root quiet
    Remove or comment out line by prefixing #.

    Code:
    # auth required pam_succeed_if.so user != root quiet
    Save and close the file. Logout from terminal and from GUI itself. Now you should be able login as root user using GDM GUI login manager.



    As an alternative, one line cut and paste:

    Code:
    su -
    sed -e 's/^auth.\+root.\+/#&/g' -i /etc/pam.d/gdm
    ONCE AGAIN, USE WITH CAUTION
    Last edited by PoppaMurph; 7th January 2009 at 01:57 AM. Reason: code usage: thanks stevea
    this works for me.....your mileage may vary:cool:

  2. #2
    Join Date
    Jun 2004
    Location
    Edinburgh
    Posts
    641
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Only one thing to say to that . . .

    DO NOT LOG IN AS ROOT!

    Cheers

    Duncan

  3. #3
    Join Date
    Nov 2008
    Location
    Kansas City (cowtown USA)
    Posts
    75
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by drunkahol
    Only one thing to say to that . . .

    DO NOT LOG IN AS ROOT!

    Cheers

    Duncan
    Sorry just an ol' slacky, and used to doing it to compile kernels....
    this works for me.....your mileage may vary:cool:

  4. #4
    scottro's Avatar
    scottro is offline Retired Community Manager -- Banned from Texas by popular demand.
    Join Date
    Sep 2007
    Location
    NYC
    Posts
    8,120
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There can be a variety of reasons why it's necessary, or useful, or time saving without risk.

    As a long time forum member said, their decision to disallow it by default was like putting training wheels into place.

    There's several posts about it, now we can tell people, Did you look through the howto section?

  5. #5
    Join Date
    Jun 2004
    Location
    Edinburgh
    Posts
    641
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm no old timer, nor am I a control freak. But the quality of Sys Admins I see around me these days forces me to put safeguards in place. That and the fact that you ain't passing no SOX audits if root logins are used.

    I would consider it nowhere near training wheels. You're not going to wipe the neighbourhood out if you fall off your bike. You can easily do such a thing as root, however. It's just not worth the risk.

    Cheers

    Duncan

  6. #6
    Join Date
    Mar 2004
    Location
    In your closet
    Posts
    15,788
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I don't have a problem with this how-to. If people want to log in as root by all means do so. Personally, I don't think I need it. I'm pretty sure I can do just as much damage using su.
    Glenn
    The Bassinator

  7. #7
    scottro's Avatar
    scottro is offline Retired Community Manager -- Banned from Texas by popular demand.
    Join Date
    Sep 2007
    Location
    NYC
    Posts
    8,120
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    While I understand drunkahol's point, and don't even disagree, it's so easy to workaround it, that I"d just as soon have this howto in place.

    People either know or will learn the hard way--I forget the exact quote, but it's something like good judgement comes from experience which comes from bad judgement.

  8. #8
    stevea Guest
    To reduce the possibility of error just cut and paste the following.

    su -
    sed -e 's/^auth.\+root.\+/#&/g' -i /etc/pam.d/gdm


    ==
    Just as it's Not Smart(tm) to use the root account as a regular user, it's also not harmful or particularly dangerous when you plan to perform sysadm type functions for an hour+ at a time.

    Yes it's exactly like training wheels. The argument that "you can wipe out the system" as root is a ridiculous rationalization. You can just as easily destroy a system using su or sudo from a user account and IMO the probability of a typo increases with command length and properly inserted sudo's in the chain.

    No - the added danger is the subversion of your root X11 session, and this is a minor concern to a reasonably configured end-user system.

    The added advantage is that you don't make as many mistakes since you aren't typing the root authentication at every tool you need.

  9. #9
    Join Date
    Nov 2008
    Location
    Kansas City (cowtown USA)
    Posts
    75
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry to start an argument! Stevea, the reason I wrote it all out is to show step by step the actions taken to achieve the results.....your copy and paste will work but some might learn more doing it the long way. And Stevea is right after hours of sys admin chores, root login is so much faster and convient. Almost cutting time in half actually! So what it boils down to is this, use if you want.....and if you don't want to nobody is twisting your arm.
    this works for me.....your mileage may vary:cool:

  10. #10
    Join Date
    Apr 2008
    Location
    www.metasdata.com
    Posts
    412
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by PoppaMurph
    Sorry to start an argument! Stevea, the reason I wrote it all out is to show step by step the actions taken to achieve the results.....your copy and paste will work but some might learn more doing it the long way. And Stevea is right after hours of sys admin chores, root login is so much faster and convient. Almost cutting time in half actually! So what it boils down to is this, use if you want.....and if you don't want to nobody is twisting your arm.
    I think this is great. I mean we're all hackers here (not in the Zero Cool sense of the word, but in the sense that we all love tooling around with computers) so it's nice to know how to do this if we so choose. There's a reason why Fedora made it the default not to be able to log in as root and I agree with that reason. But that doesn't mean we shouldn't be able to, and know how to. Isn't that the whole reason we do this? To learn as much as we can?

  11. #11
    stevea Guest
    Quote Originally Posted by PoppaMurph
    Sorry to start an argument! Stevea, the reason I wrote it all out is to show step by step the actions taken to achieve the results.....your copy and paste will work but some might learn more doing it the long way. And Stevea is right after hours of sys admin chores, root login is so much faster and convient. Almost cutting time in half actually! So what it boils down to is this, use if you want.....and if you don't want to nobody is twisting your arm.
    I don't think we disagree.

    My one-liner is safer for a cut-n-paste - less chance of an error. OTOH If you can't read 'sed' commands it is not self-explanatory like yours.

  12. #12
    Join Date
    Nov 2008
    Location
    Kansas City (cowtown USA)
    Posts
    75
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    DONE AND DONE....(spit and shake) ROFLMAO
    this works for me.....your mileage may vary:cool:

  13. #13
    unhappy_user Guest
    At the risk of incurring more wrath, I'm going add my Best Practice to this discussion.

    When performing one or two administrative tasks, use sudo. It quick and easy enough.

    When doing half a dozen, go ahead and use su -, if you must. But get in, be careful and get out. Don't keep that window open on your desktop. If you get distracted, you may use it accidentally.

    But in my option, it is better to login as root, when doing administrative tasks. Same rule applies -- "get in, be careful, and get out". I change root's desktop and terminal background, so it is immediately recognizable.

    My reasoning is the possibility that the su- window, among a dozen other user windows, may be used inadvertently for routine tasks. I get phone call, two people stop by my door, another phone call, and the next thing you know I'm using vi in that su- window to type a memo. That cannot happen if I login as root, because the background color of the terminal and desktop is a warning.

    Thanks to PoppaMurph for the HowTo.

  14. #14
    wlayton27 Guest
    Drunkahol is absolutely right on this one. I really don't feel like (once I've gained some Linux experience) listening to people gripe about how stupid their Linux operating system is and all the crap it lets them get away with without posting so much as a warning.

    If you log in as "root" (on a computer that you care about), the consequences are all on you. That thread is there for a good reason, and adding your user to the "sudoers" file and completing individual commands under root priveledges is absolutely the way to go.

  15. #15
    Join Date
    Sep 2006
    Location
    Connellsville, PA, USA
    Posts
    11,308
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thread closed to posting at the request of the OP.

    V

Similar Threads

  1. No root login allowed at login screen - Fedora 10
    By mitchellray in forum Using Fedora
    Replies: 2
    Last Post: 2nd April 2009, 02:13 AM
  2. f10 can't login root at login screen - su works fine
    By bobatlcpmbdx in forum Using Fedora
    Replies: 2
    Last Post: 1st January 2009, 05:36 PM
  3. fedora 10 auto login and root login issue
    By pcandpc in forum Using Fedora
    Replies: 0
    Last Post: 22nd December 2008, 05:44 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •