# root password wont work in su anymore [SOLVED]

## h2sammo

i added a new user by mistake, now i am trying to delete that user, but i realized i cannot login as root anymore.

my root password wont work anymore, any ideas on how i can troubleshoot this>?Last edited by h2sammo on Tue Sep 22, 2009 5:05 pm; edited 1 time in total

----------

## John R. Graham

Does it not work with just "su" or can you not log in from scratch as root either?

- John

----------

## h2sammo

i cannot login as root anywhere.

i tried this: 

http://gentoo.linuxhowtos.org/TipsTricks/recover_root_passwd.htm

i tried booting from install CD, chrooted and ran passwd and changed it, but when i boot from hard drive it will not take my new password either.  i can log from my user though.

----------

## h2sammo

i think i must have taken my user out of some group it needs to be in to give me permission to su to root from it.

i logged in as single user from grub and inspected and played with /etc/shadow and it takes new passwords for both root and user properly, HOWEVER if i log in as my user and try to su as root, it gives the no permission error i posted earlier.

HOW can i see what groups my user is in, and what groups could i be absent from which might cause this?

----------

## h2sammo

ok i figured it out.

```
 useradd -G vmware username 
```

will replace all the groupnames i have with vmware.  so thats what happened, my username was out of whell (which allows me to use su, and all the others)

i think i should have used the --append option (-o) with useradd so that it adds my user to that group and it does NOT replace me from my current groups with that particular one ONLY.

----------

