Find the answer to your Linux question:
Results 1 to 6 of 6
I was editing a user in Kuser (added a user to 2 groups). When I exited, it gave me an error on not being able to write to 'shadow'. Now, ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Engineer psic's Avatar
    Join Date
    Nov 2004
    Location
    Ljubljana, Slovenia
    Posts
    1,205

    Root password gone?


    I was editing a user in Kuser (added a user to 2 groups). When I exited, it gave me an error on not being able to write to 'shadow'. Now, I can not log on at all (both the user password and root passwords do not work, it gives me an error that the logon failed). The distro is Morphix. I am afraid that I'll have to reinstall
    Stumbling around the 'net:
    www.cloudyuseful.com

  2. #2
    Linux Guru
    Join Date
    May 2004
    Location
    forums.gentoo.org
    Posts
    1,817
    I don't know Morphix, but if you have a CD that you can use to boot to (rescue CD or Live CD), if you edit /etc/passwd to delete the password for root, it may help:
    Code:
    ....before....
    root:x:0:0:root:/root:/bin/bash
    ....after....
    root::0:0:root:/root:/bin/bash
    If it works like it does in Fedora, next time you login as root, you will not need to provide a password. You should then use the 'passwd' command to reset it.
    /IMHO
    //got nothin'
    ///this use to look better

  3. #3
    Linux Engineer psic's Avatar
    Join Date
    Nov 2004
    Location
    Ljubljana, Slovenia
    Posts
    1,205
    Thanks for the suggestion, but I've already reinstalled the sistem. Works OK now. It is not really a loss, as I am just starting to play around with it anyway.
    Stumbling around the 'net:
    www.cloudyuseful.com

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Newbie
    Join Date
    Apr 2005
    Location
    Charlottesville, VA
    Posts
    175
    You could also have added "single" to the kernel options and typed "passwd" there. I think that's even easier than booting from a livecd.
    ---sxeraverx---
    Linux without a C Compiler is like eating Spaghetti with your mouth sewn shut. It just doesn't make sense.

  6. #5
    Linux User
    Join Date
    Oct 2004
    Location
    Serbia&Montenegro
    Posts
    281
    Or you could boot the sistem with Live CD and change the shadow file.
    Linux registered user #358842
    Human knowledge belongs to the world.

  7. #6
    dew
    dew is offline
    Just Joined!
    Join Date
    May 2005
    Posts
    5

    root passwd gone - reply

    dear misc

    :) :) If you are using LILO then while u boot at the prompt type linux single and press enter. it will give you the # prompt . Then type passwd & enter a new password for root. It will show you all tokens successfully updated & then it will carry on with the boot.
    If you are using grub then when the option to select OS appears, click on e . then select the kernel option & append single at the end of the line. & then press b to boot. It will give you the bash prompt ..Change password with passwd command , if it asks for the old password then reboot ....do the same things only at the end of the line instead of single also add init=/bin/bash & then press b. This time you can change the password with passwd command.
    Then login with the new password. can also delete the user's account & create a new one.

    For changing root password you need not re-install linux.

    See if it works or not.

Posting Permissions

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