Results 1 to 9 of 9

Thread: Password suddenly stopped working on Ubuntu Server

  1. #1
    Join Date
    Nov 2011
    Beans
    5

    Password suddenly stopped working on Ubuntu Server

    Hello,

    I recently installed ubuntu server to use as a LAMP server. I just logged in via SSH, and tried to execute a sudo command. It gave me the message:
    Code:
    username is not in the sudoers file.  This incident will be reported.
    I tried logging in from the computer directly and it said my password was wrong!
    I am using the original user I originally set up. This was working earlier today. I was about to do a reinstall, but thought I'd see if I could fix it first.

    Anybody know whats going on?
    Thanks!

  2. #2
    Join Date
    Feb 2009
    Location
    Dallas, TX
    Beans
    7,153
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Password suddenly stopped working on Ubuntu Server

    Somehow to got yourself out of the admin group.

    Here's a guide to recover from that situation.

    Regards.

  3. #3
    Join Date
    Nov 2011
    Beans
    5

    Re: Password suddenly stopped working on Ubuntu Server

    Ok, when I hold down the shift key at boot, I see the boot options screen flash, and then it continues normally. How do i get it to stay?

  4. #4
    Join Date
    Feb 2009
    Location
    Dallas, TX
    Beans
    7,153
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Password suddenly stopped working on Ubuntu Server

    Once you see the menu, I believe if you press the down arrow key, grub will set itself into interactive mode.

    Regards.

  5. #5
    Join Date
    Nov 2011
    Beans
    5

    Re: Password suddenly stopped working on Ubuntu Server

    So i got into the root shell prompt, and now it says:
    Code:
    Adding user 'username' to group 'admin'...
    Adding user username to group admin
    gpasswd: cannot lock /etc/group; try again later.
    adduser: '/usr/bin/gpasswd -a username admin' returned error code 1. Exiting.
    What does that mean?

  6. #6
    Join Date
    Feb 2009
    Location
    Dallas, TX
    Beans
    7,153
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Password suddenly stopped working on Ubuntu Server

    Looks like there are already locks (something went wrong?). Check it like this:
    Code:
    ls /etc/passwd.lock /etc/shadow.lock /etc/group.lock /etc/gshadow.lock
    If you are in safe mode, with a root prompt (#) you can delete them:
    Code:
    rm -i /etc/passwd.lock /etc/shadow.lock /etc/group.lock /etc/gshadow.lock
    And then try again to add yourself to the admin group.

    Hope it helps,
    Regards.

  7. #7
    Join Date
    Nov 2011
    Beans
    5

    Re: Password suddenly stopped working on Ubuntu Server

    It says No such file or directory. Would it just be easier to reinstall everything?

  8. #8
    Join Date
    Nov 2011
    Beans
    5

    Re: Password suddenly stopped working on Ubuntu Server

    Alright, I figured it out. Apparrently recovery mode was in read only mode. Once i fixed that:
    Code:
    mount -rw -o remount /
    It worked perfectly. Thanks for the help!

  9. #9
    Join Date
    Feb 2009
    Location
    Dallas, TX
    Beans
    7,153
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: Password suddenly stopped working on Ubuntu Server

    Oh my! very interesting!

    Thanks for posting that! When you have the chance, mark the thread solved so other people can take notice.

    Kind Regards.

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
  •