Find the answer to your Linux question:
Results 1 to 4 of 4
Hi, I need some help, please…. How to take the back up of /etc/sudoers file before editing it? What is the command to use to take the back up of ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie
    Join Date
    May 2012
    Posts
    110

    /etc/sudoers file back up steps needed, please ...


    Hi,

    I need some help, please….

    How to take the back up of /etc/sudoers file before editing it?

    What is the command to use to take the back up of this file?

    Please help me with your answers..

    Last time, without taking back up of this file I have edited and when the customer was not able to login through root, I came to know that the file got corrupted. So, I thought its better to take back up of this file first and then edit it.

    I need full command to take the back up of this file /etc/sudoers.


    Regards,
    Aparna.

  2. #2
    Linux Guru Jonathan183's Avatar
    Join Date
    Oct 2007
    Posts
    3,043
    I suggest you just use cp as root to copy the sudoers file and use visudo to edit it ...

  3. #3
    Linux Newbie
    Join Date
    May 2012
    Posts
    110
    Hi,

    Thank you for your assistance...I would be grateful if you could help me on this matter.

    I want to know to which Location is this command copied

    # cp /etc/sudoers /etc/sudoers.backup ?

    I am not giving any mount point over here, then where does this back up file copied ?

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru Jonathan183's Avatar
    Join Date
    Oct 2007
    Posts
    3,043
    suggest you review man pages information
    man cp sudoers visudo

    you should be able to work out where files will end up, if they have been symlinked etc using a combination of mount and ls commands
    mount
    ls -l /etc

Posting Permissions

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