Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    /etc/sudoers file got corrupted..what to do now ?


    I have an issue in Linux.

    /etc/sudoers file got corrupted and no one from our team were able to root Login.

    What to do now ?

    How to root login now?

    How to sudo login?

    Can anybody give me good solution for this issue?


  2. #2
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    One method is to boot this machine with a liveCD,
    mount the partition containing /etc
    and fix /etc/sudoers

    Fwiw, to cover such cases, our machines are configured like this:
    - ssh will not allow root logins
    - remote users need to login with their key
    - and elevate with sudo to root via their user password

    - *local* root logins are still allowed, though
    -> Which means, if you have access (and authenticate) to the iLo,
    or have physical access to the box,
    then you can login directly with the root pw and hotfix whatever is broken.

    There is also the more elegant method via the systemconfig tool puppet in place.
    If sudo is broken, puppet would be able to fix it, because it runs with root.
    You must always face the curtain with a bow.

  3. #3
    Thanks for your Immdiate response.

    I would like to request you ,how this puppet tool works ?

    Can you please provide me any document for it ?


  4. $spacer_open
  5. #4
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Sure, here:
    Learning Puppet ? Documentation ? Puppet Labs
    But for the case at hand it wont help you, as it is not deployed and configured yet on your machines.

    Can you locally login with root or boot the machine with a liveCD?
    You must always face the curtain with a bow.

  6. #5
    No ! I am not able to login with root now.

    What I have done is rebooted the server. But this is a very critical way and I don't think this is good solution to root login.

    So,I would like to request you , how to install Puppet ? Where to install Puppet.

    We have around 400 Linux Boxes and all are REDHAT LINUX.

    Do I need to install PUPPET manually in each and every server ?

    Please your assisstance is valuable for me.


  7. #6
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    puppet is part of the default redhat repository.
    Not so sure about rhel5, but definitely 6.
    (We compiled and packaged it into a rpm and it is available via our private repo.
    This is because a) we can and b) we use pretty new features which are not in the default redhat rpm of puppet)

    We install puppet as part of the kickstart process.
    So whenever a new machine getīs bootstrapped via pxe boot, puppet will be installed.

    In your case, maybe install it half-manually with a ssh multiplexer such as pssh or cssh.
    - This is a very potent and versatile tool.
    - I understand it as a programming language for datacenter environments.
    - Installing the package means nothing.
    - Just like installing a c-compiler such as gcc is only a very first and basic step for coding an application or tool.

    I encourage you to learn puppet (or any systemconfig tool for that matter. Chef and cfengine can also do the job)
    In fact, I wonder how you manage 400 machines *without* such a tool.
    But please be aware, that you would have to
    - learn puppet
    - then create design principles, that match your usecases and datacenter.
    - then create the puppet manifests.
    - then roll out what you created

    This is not an easy task. I dont know your environment,
    but just judging from the amount of machines, I would guess several weeks or even months of work.

    My advice would be:
    - do the tutorial
    - start small, with your local workstation (or a local VM) to get a feel
    You must always face the curtain with a bow.

  8. #7
    But my question over here is, how Puppet fixes /etc/sudoers corrupted file and will allow root login ?

  9. #8
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    As I said.
    It wont help you now, as it is not deployed yet.

    It is just a suggestion for the future.
    You must always face the curtain with a bow.

  10. #9
    I understand that it won't help me right now, but what is the procedure to use in future if I come across same issue in future ?

    I want to over come such issues in future.

    So, how to install the PUPPET and LINUX Boxes ?

  11. #10
    Does this solution works ?

    For RedHat derived versions you can do a reboot and interrupt the boot then edit the boot line to add "1" to the end of the line and tell it to boot using

    that line. This will boot into single user without requiring a password and change the password for root so it allows you to login. (This all has to be done

    from the system console.)

Posting Permissions

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