Professional Web Applications Themes

Reinitializing passwd file - Linux Setup, Configuration & Administration

For reasons I don't wish to get into here, I've totally ed up my passwd/shadow files (let's just say I was trying to do edit them by hand and it got out of control). I can't even log on via root any more. I'd like to start from scratch and create some new passwd/shadow files. I assume I can just start up in single user mode (LILO->boot:linux single) but then what? Can I just delete the existing passwd and shadow files (and maybe oshadow and opasswd) and start fresh by adding all the users back by hand? Is there some ...

  1. #1

    Default Reinitializing passwd file

    For reasons I don't wish to get into here, I've totally ed up my
    passwd/shadow files (let's just say I was trying to do edit them by
    hand and it got out of control). I can't even log on via root any
    more. I'd like to start from scratch and create some new
    passwd/shadow files. I assume I can just start up in single user mode
    (LILO->boot:linux single) but then what? Can I just delete the
    existing passwd and shadow files (and maybe oshadow and opasswd) and
    start fresh by adding all the users back by hand? Is there some place
    that has the original files as they were at install time so I can just
    use those? I'm running RedHat Linux Advanced Server v2 on an IA64 HP
    machine.
    kenneth Guest

  2. #2

    Default Re: Reinitializing passwd file

    kenneth kahn <net> wrote: 

    With RH they should be in the "setup-*.rpm" I'd extract them from there
    and use those. Always make a backup first if you really need to edit
    critical files with vi. You don't have /etc/shadow-, /etc/passwd-
    anymore?

    One could use 'usermod' for this, which takes care about the syntax.

    --
    Michael Heiming - RHCE

    Remove +SIGNS and www. if you expect an answer, sorry for
    inconvenience, but I get tons of SPAM
    Michael Guest

  3. #3

    Default Re: Reinitializing passwd file

    kenneth kahn wrote:
     

    ..... there should be a backup of the file, depending
    on the editor you used, check for the backup first and
    if there, just copy over the top of the real ones
    ..
    --
    /// Michael J. Tobler: motorcyclist, surfer, skydiver, \\\
    \\\ and author: "Inside Linux", "C++ HowTo", "C++ Unleashed" ///
    Beware of Programmers who carry drivers. - Leonard Brandwein

    mjt Guest

  4. #4

    Default Re: Reinitializing passwd file

    Lucky I found a remote development workstation that was still logged
    on as root to the system, so that made things easier. Copying passwd-
    and shadow- worked, thanks (I'll try to be more careful and backup
    better next time).
    kenneth Guest

  5. Moderated Post

    Default Re: Reinitializing passwd file

    Removed by Administrator
    Nico Guest
    Moderated Post

Similar Threads

  1. script for passwd file
    By Rmck in forum PERL Beginners
    Replies: 2
    Last Post: December 17th, 05:22 AM
  2. passwd file
    By Sherman H. in forum AIX
    Replies: 5
    Last Post: October 9th, 07:25 PM
  3. Lost passwd file
    By Robert DiRosario in forum AIX
    Replies: 1
    Last Post: July 23rd, 02:28 AM
  4. Blue Screen / Recovery / Admin Passwd not Assgnd / User Passwd Assgnd
    By Terry B. in forum Windows Setup, Administration & Security
    Replies: 2
    Last Post: July 20th, 02:49 AM
  5. [PHP] /etc/passwd
    By Mike Ford in forum PHP Development
    Replies: 0
    Last Post: July 11th, 09:39 AM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139