# Can't log in tp user or root [SOLVED]

## scheistermeister

Last night I was updating my system with emerge --update --deep --newuse world and all seemed to go well. Did etc-update when it was done and also revdep-rebuild. Then a little later I was talking to a friend when my whole system pretty much locked up. Moved to another box and tried to ssh into it and didn't even get a login prompt. So I just turned it off. When I powered it back on I was shocked to see that my two SATA drives were not detected. I turned it off again and opened the case and found that power connectors to them had come loose. Plugged them back in and fired it back up and everything seemed to go smoothly till I got to the login prompt. Tried to log in as both a regular user and as root and was met with login incorrect. Tried to ssh into again and got the same thing there. Rebooted with a livecd, mounted my drive and chrooted in. First time I did it I just tried to reset the passwords to what they were, it said it was successful and I rebooted and got the same thing. Second time I did it I re-emerged pam and shadow and then reset the passwords with passwd and got the same thing. I am sorta stuck and don't know where to go from there. I also read in another thread about uncommenting a line in /etc/pam.d/login and tried it, but it didn't help at all. What should I try next? 

Let me know what I should post up and I will get it up as soon as possible.

Edit: Fixed it. Took this line out of /etc/pam.d/login

```
auth       required   pam_shells.so
```

Anyone have a guess as to why that doesn't work?Last edited by scheistermeister on Tue Jan 01, 2008 10:32 am; edited 1 time in total

----------

## bunder

some info from /var/log/auth.log could help... as well as your /etc/pam.d/system-auth file.

cheers

----------

## scheistermeister

 *bunder wrote:*   

> some info from /var/log/auth.log could help... as well as your /etc/pam.d/system-auth file.
> 
> cheers

 

Here ya go, don't know how far you want me to go back so I just went a few days on the auth.log, let me know if you need more.

/etc/pam.d/system-auth

```

#%PAM-1.0

auth       required   pam_env.so

auth       sufficient   pam_unix.so try_first_pass likeauth nullok

auth       required   pam_deny.so

account    required   pam_unix.so

password   required   pam_cracklib.so difok=2 minlen=8 dcredit=2 ocredit=2 try_first_pass retry=3

password   sufficient   pam_unix.so try_first_pass use_authtok nullok md5 shadow

password   required   pam_deny.so

session    required   pam_limits.so

session    required   pam_unix.so

```

```

Dec 12 03:29:09 Zaraki sshd[6280]: Server listening on 0.0.0.0 port 22.

Dec 12 03:30:22 Zaraki login[8246]: pam_tally(login:auth): unknown option: no_magic_root

Dec 12 03:30:24 Zaraki login[8246]: pam_tally(login:account): option deny=0 allowed in auth phase only

Dec 12 03:30:24 Zaraki login[8246]: pam_tally(login:account): unknown option: no_magic_root

Dec 12 03:30:24 Zaraki login[8246]: pam_tally(login:setcred): unknown option: no_magic_root

Dec 12 03:30:24 Zaraki login[8246]: pam_unix(login:session): session opened for user scheister by LOGIN(uid=0)

Dec 12 03:35:48 Zaraki su[9086]: pam_unix(su:auth): authentication failure; logname= uid=1000 euid=0 tty=pts/3 ruser=scheister rhost=  user=root

Dec 12 03:35:50 Zaraki su[9086]: pam_authenticate: Authentication failure

Dec 12 03:35:50 Zaraki su[9086]: FAILED su for root by scheister

Dec 12 03:35:50 Zaraki su[9086]: - pts/3 scheister:root

Dec 12 03:35:54 Zaraki su[9094]: Successful su for root by scheister

Dec 12 03:35:54 Zaraki su[9094]: + pts/3 scheister:root

Dec 12 03:35:54 Zaraki su[9094]: pam_unix(su:session): session opened for user root by (uid=1000)

Dec 12 03:35:54 Zaraki su[9094]: pam_unix(su:session): session closed for user root

Dec 12 03:35:54 Zaraki su[9100]: Successful su for root by scheister

Dec 12 03:35:54 Zaraki su[9100]: + pts/3 scheister:root

Dec 12 03:35:54 Zaraki su[9100]: pam_unix(su:session): session opened for user root by (uid=1000)

Dec 12 03:37:47 Zaraki su[9100]: pam_unix(su:session): session closed for user root

Dec 12 04:00:36 Zaraki su[11607]: Successful su for root by scheister

Dec 12 04:00:36 Zaraki su[11607]: + pts/0 scheister:root

Dec 12 04:00:36 Zaraki su[11607]: pam_unix(su:session): session opened for user root by scheister(uid=1000)

Dec 12 04:19:34 Zaraki su[11607]: pam_unix(su:session): session closed for user root

Dec 12 04:21:19 Zaraki su[12971]: Successful su for root by scheister

Dec 12 04:21:19 Zaraki su[12971]: + pts/1 scheister:root

Dec 12 04:21:19 Zaraki su[12971]: pam_unix(su:session): session opened for user root by scheister(uid=1000)

Dec 12 04:21:24 Zaraki su[12971]: pam_unix(su:session): session closed for user root

Dec 12 04:21:31 Zaraki sshd[6280]: Received signal 15; terminating.

Dec 16 23:45:14 Zaraki sshd[6266]: Server listening on 0.0.0.0 port 22.

Dec 17 06:21:09 Zaraki login[8237]: pam_tally(login:auth): unknown option: no_magic_root

Dec 17 06:21:12 Zaraki login[8237]: pam_tally(login:account): option deny=0 allowed in auth phase only

Dec 17 06:21:12 Zaraki login[8237]: pam_tally(login:account): unknown option: no_magic_root

Dec 17 06:21:12 Zaraki login[8237]: pam_tally(login:setcred): unknown option: no_magic_root

Dec 17 06:21:12 Zaraki login[8237]: pam_unix(login:session): session opened for user root by LOGIN(uid=0)

Dec 17 06:21:12 Zaraki login[8907]: ROOT LOGIN  on 'tty1'

Dec 17 06:21:23 Zaraki sshd[6266]: Received signal 15; terminating.

Dec 17 20:49:13 Zaraki sshd[6284]: Server listening on 0.0.0.0 port 22.

Dec 18 08:26:34 Zaraki login[8249]: pam_tally(login:auth): unknown option: no_magic_root

Dec 18 08:26:36 Zaraki login[8249]: pam_tally(login:account): option deny=0 allowed in auth phase only

Dec 18 08:26:36 Zaraki login[8249]: pam_tally(login:account): unknown option: no_magic_root

Dec 18 08:26:36 Zaraki login[8249]: pam_tally(login:setcred): unknown option: no_magic_root

Dec 18 08:26:36 Zaraki login[8249]: pam_unix(login:session): session opened for user root by LOGIN(uid=0)

Dec 18 08:26:36 Zaraki login[9225]: ROOT LOGIN  on 'tty1'

Dec 18 08:26:45 Zaraki sshd[6284]: Received signal 15; terminating.

Dec 20 09:29:55 Zaraki sshd[6360]: Server listening on 0.0.0.0 port 22.

Dec 20 09:31:00 Zaraki login[8377]: pam_tally(login:auth): unknown option: no_magic_root

Dec 20 09:31:02 Zaraki login[8377]: pam_tally(login:account): option deny=0 allowed in auth phase only

Dec 20 09:31:02 Zaraki login[8377]: pam_tally(login:account): unknown option: no_magic_root

Dec 20 09:31:02 Zaraki login[8377]: pam_tally(login:setcred): unknown option: no_magic_root

Dec 20 09:31:02 Zaraki login[8377]: pam_unix(login:session): session opened for user scheister by LOGIN(uid=0)

Dec 20 09:31:46 Zaraki su[8595]: Successful su for root by scheister

Dec 20 09:31:46 Zaraki su[8595]: + pts/0 scheister:root

Dec 20 09:31:46 Zaraki su[8595]: pam_unix(su:session): session opened for user root by scheister(uid=1000)

Dec 20 09:33:00 Zaraki su[8595]: pam_unix(su:session): session closed for user root

Dec 20 09:37:33 Zaraki su[9172]: Successful su for root by scheister

Dec 20 09:37:33 Zaraki su[9172]: + pts/2 scheister:root

Dec 20 09:37:33 Zaraki su[9172]: pam_unix(su:session): session opened for user root by scheister(uid=1000)

Dec 20 10:04:13 Zaraki su[11479]: Successful su for root by scheister

Dec 20 10:04:13 Zaraki su[11479]: + pts/3 scheister:root

Dec 20 10:04:13 Zaraki su[11479]: pam_unix(su:session): session opened for user root by scheister(uid=1000)

Dec 21 08:05:10 Zaraki su[1925]: Successful su for root by scheister

Dec 21 08:05:10 Zaraki su[1925]: + pts/4 scheister:root

Dec 21 08:05:10 Zaraki su[1925]: pam_unix(su:session): session opened for user root by scheister(uid=1000)

Dec 21 08:08:00 Zaraki su[9172]: pam_unix(su:session): session closed for user root

Dec 21 08:19:31 Zaraki su[3012]: Successful su for root by scheister

Dec 21 08:19:31 Zaraki su[3012]: + pts/5 scheister:root

Dec 21 08:19:31 Zaraki su[3012]: pam_unix(su:session): session opened for user root by scheister(uid=1000)

Dec 21 08:22:24 Zaraki su[3229]: Successful su for root by scheister

Dec 21 08:22:24 Zaraki su[3229]: + pts/6 scheister:root

Dec 21 08:22:24 Zaraki su[3229]: pam_unix(su:session): session opened for user root by scheister(uid=1000)

Dec 21 20:00:34 Zaraki su[3229]: pam_unix(su:session): session closed for user root

Dec 21 22:31:54 Zaraki useradd[13421]: new user: name=festival, UID=109, GID=18, home=/dev/null, shell=/sbin/nologin   <-What is that? Was that made by some program, cause I didn't do it.

Dec 22 10:25:01 Zaraki su[3012]: pam_unix(su:session): session closed for user root

Dec 22 10:25:01 Zaraki su[1925]: pam_unix(su:session): session closed for user root

Dec 22 10:25:01 Zaraki su[11479]: pam_unix(su:session): session closed for user root

Dec 22 10:25:08 Zaraki su[14127]: Successful su for root by scheister

Dec 22 10:25:08 Zaraki su[14127]: + tty1 scheister:root

Dec 22 10:25:08 Zaraki su[14127]: pam_unix(su:session): session opened for user root by scheister(uid=1000)

Dec 22 10:27:02 Zaraki su[14127]: pam_unix(su:session): session closed for user root

Dec 22 10:27:54 Zaraki su[15191]: Successful su for root by scheister

Dec 22 10:27:54 Zaraki su[15191]: + pts/0 scheister:root

Dec 22 10:27:54 Zaraki su[15191]: pam_unix(su:session): session opened for user root by scheister(uid=1000)

Dec 22 10:30:19 Zaraki su[16580]: Successful su for root by scheister

Dec 22 10:30:19 Zaraki su[16580]: + pts/3 scheister:root

Dec 22 10:30:19 Zaraki su[16580]: pam_unix(su:session): session opened for user root by scheister(uid=1000)

Dec 22 10:48:45 Zaraki su[15191]: pam_unix(su:session): session closed for user root

Dec 22 10:48:45 Zaraki su[16580]: pam_unix(su:session): session closed for user root

Dec 22 10:49:23 Zaraki su[32336]: Successful su for root by scheister

Dec 22 10:49:23 Zaraki su[32336]: + pts/0 scheister:root

Dec 22 10:49:23 Zaraki su[32336]: pam_unix(su:session): session opened for user root by scheister(uid=1000)

Dec 22 10:50:58 Zaraki su[32383]: Successful su for root by scheister

Dec 22 10:50:58 Zaraki su[32383]: + pts/1 scheister:root

Dec 22 10:50:58 Zaraki su[32383]: pam_unix(su:session): session opened for user root by scheister(uid=1000)

Dec 22 11:52:22 Zaraki su[32336]: pam_unix(su:session): session closed for user root

Dec 22 11:52:22 Zaraki su[32383]: pam_unix(su:session): session closed for user root

Dec 22 11:53:05 Zaraki su[31407]: Successful su for root by scheister

Dec 22 11:53:05 Zaraki su[31407]: + pts/1 scheister:root

Dec 22 11:53:05 Zaraki su[31407]: pam_unix(su:session): session opened for user root by scheister(uid=1000)

Dec 22 11:57:05 Zaraki su[31407]: pam_unix(su:session): session closed for user root

Dec 22 11:59:16 Zaraki su[31689]: Successful su for root by scheister

Dec 22 11:59:16 Zaraki su[31689]: + pts/0 scheister:root

Dec 22 11:59:16 Zaraki su[31689]: pam_unix(su:session): session opened for user root by scheister(uid=1000)

Dec 22 11:59:51 Zaraki su[31689]: pam_unix(su:session): session closed for user root

Dec 22 12:01:07 Zaraki su[31837]: Successful su for root by scheister

Dec 22 12:01:07 Zaraki su[31837]: + pts/0 scheister:root

Dec 22 12:01:07 Zaraki su[31837]: pam_unix(su:session): session opened for user root by scheister(uid=1000)

Dec 22 12:10:31 Zaraki su[28450]: Successful su for root by scheister

Dec 22 12:10:31 Zaraki su[28450]: + pts/1 scheister:root

Dec 22 12:10:31 Zaraki su[28450]: pam_unix(su:session): session opened for user root by scheister(uid=1000)

Dec 22 12:11:40 Zaraki su[28450]: pam_unix(su:session): session closed for user root

Dec 22 12:13:17 Zaraki su[31465]: Successful su for root by scheister

Dec 22 12:13:17 Zaraki su[31465]: + pts/3 scheister:root

Dec 22 12:13:17 Zaraki su[31465]: pam_unix(su:session): session opened for user root by scheister(uid=1000)

Dec 22 12:28:57 Zaraki su[15065]: Successful su for root by scheister

Dec 22 12:28:57 Zaraki su[15065]: + pts/5 scheister:root

Dec 22 12:28:57 Zaraki su[15065]: pam_unix(su:session): session opened for user root by scheister(uid=1000)

```

----------

## scheistermeister

Still needing help with this, anyone else have any suggestions?

----------

## noisebleed

Hi scheistermeister.

I've also had to remove 

```
auth       required   pam_shells.so
```

 from /etc/pam.d/login and /etc/pam.d/sshd.

Have you found out why that doesn't work?

----------

