Welcome to the Linux Foundation Forum!

Password reset for Ubuntu 10.10 RAID5 server

Options

My most sincere apologies if this is the wrong place to put this question but i'm a little desperate.

A friend was supposed to help me setup a Linux Server and after some time of not using the server because it was missing a drive i got tired of waiting and decided to rescue my data. Now i'm stuck at the login prompt and he has forgotten the user ID.

how can i recover the password for this server? I've done some looking up and there seems to be several methods, but i'm a total noob at Linux and I need step by step help. pleeeeeease.

thanks

Comments

  • marc
    marc Posts: 647
    Options
    You need to access the hard drive whether it's placing it in another machine or booting from a LiveCD

    From there, you must edit the files /etc/passwd and /etc/shadow and edit the lines for the user you want to change the password of. Write there *exactly* the same of a user that you haven't forgotten the password of (can be the same text from another computer).

    Reboot the machine and you are ready to go :)

    Regards
  • woboyle
    woboyle Posts: 501
    Options
    How to do it depends upon a number of factors, such as what authentication method the server was configured with - standard (password is stored encrypted in /etc/shadow), or some sort of single sign-on such as YP or LDAP. I would boot with a Live CD/DVD, login as root, mount the server / directory somewhere, such as /mnt/server-root, then chroot to that directory. At that point, you should be able to use the normal passwd utility to update the password to something you and your colleague can remember. Alternatively, you can setup sudo on the server file system so that you can login as a normal user, and then reboot, login as yourself, "sudo su" to root, and run passwd to change the root password. Clear as mud, right? :-) Anyway, see if you can make sense out of this. If not, I'll try to do a step-by-step process map for you.
  • marc
    marc Posts: 647
    Options
    woboyle wrote:
    How to do it depends upon a number of factors, such as what authentication method the server was configured with - standard (password is stored encrypted in /etc/shadow), or some sort of single sign-on such as YP or LDAP. I would boot with a Live CD/DVD, login as root, mount the server / directory somewhere, such as /mnt/server-root, then chroot to that directory. At that point, you should be able to use the normal passwd utility to update the password to something you and your colleague can remember. Alternatively, you can setup sudo on the server file system so that you can login as a normal user, and then reboot, login as yourself, "sudo su" to root, and run passwd to change the root password. Clear as mud, right? :-) Anyway, see if you can make sense out of this. If not, I'll try to do a step-by-step process map for you.

    Your solution is way more elegant than mine :)
  • raluxs
    raluxs Posts: 20
    Options
    As I understand it, you need the root password (root being the usual administrator user). Once you can log in as root you can change any users password. Here is a How To to recover lost root passwords:

    http://www.debuntu.org/recover-root-password-single-user-mode-and-grub

    Good luck
  • marc
    marc Posts: 647
    Options
    raluxs wrote:
    As I understand it, you need the root password (root being the usual administrator user). Once you can log in as root you can change any users password. Here is a How To to recover lost root passwords:

    http://www.debuntu.org/recover-root-password-single-user-mode-and-grub

    Good luck

    You can change any password without needing root's password although it's simpler if you get it first ;)

Categories

Upcoming Training