Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
login failed
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
johntramp
Guru
Guru


Joined: 03 Feb 2004
Posts: 457
Location: New Zealand

PostPosted: Thu Oct 14, 2004 4:10 am    Post subject: login failed Reply with quote

hi. I have just changed from x86 to ~x86 and have jst done an etc-update. I went through about 60 config files and saved all the ones which I had edited and then did -5 on the rest. It seems one of the files had something to do with the logins and now I can not log on as any user. What should I do about this.. would booting off a live cd and chrooting in to add a user do the trick or is there something else I can do?

Thanks
Back to top
View user's profile Send private message
Taladar
Guru
Guru


Joined: 09 Oct 2004
Posts: 458
Location: Bielefeld, Germany

PostPosted: Thu Oct 14, 2004 5:35 am    Post subject: Reply with quote

You could boot off a live cd and investigate the Content of
/etc/passwd and /etc/shadow. Both files should have one entry for each user. You could also have a look at /etc/pam.d/login which are the PAM rules for the login-Program.
My unmodified /etc/pam.d/login looks like this:
Code:

#%PAM-1.0

auth       required     /lib/security/pam_securetty.so
auth       required     /lib/security/pam_stack.so service=system-auth
auth       required     /lib/security/pam_nologin.so

account    required     /lib/security/pam_stack.so service=system-auth

password   required     /lib/security/pam_stack.so service=system-auth

session    required     /lib/security/pam_stack.so service=system-auth
session    optional     /lib/security/pam_console.so


If you only tried to login as root: the file /etc/securetty contains the name of all terminals where root may login.
Back to top
View user's profile Send private message
johntramp
Guru
Guru


Joined: 03 Feb 2004
Posts: 457
Location: New Zealand

PostPosted: Thu Oct 14, 2004 8:30 am    Post subject: Reply with quote

I can not log in as any user, as if they don't exist. I will havea look at those files.
Back to top
View user's profile Send private message
johntramp
Guru
Guru


Joined: 03 Feb 2004
Posts: 457
Location: New Zealand

PostPosted: Thu Oct 14, 2004 11:40 am    Post subject: Reply with quote

Quote:
root@ttyp0[etc]# cat passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh
sys:x:3:3:sys:/dev:/bin/sh
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/bin/sh
man:x:6:12:man:/var/cache/man:/bin/sh
lp:x:7:7:lp:/var/spool/lpd:/bin/sh
mail:x:8:8:mail:/var/mail:/bin/sh
news:x:9:9:news:/var/spool/news:/bin/sh
uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
proxy:x:13:13:proxy:/bin:/bin/sh
majordom:x:30:31:Majordomo:/usr/lib/majordomo:/bin/sh
postgres:x:31:32:postgres:/var/lib/postgres:/bin/sh
www-data:x:33:33:www-data:/var/www:/bin/sh
backup:x:34:34:backup:/var/backups:/bin/sh
msql:x:36:36:Mini SQL Database Manager:/var/lib/msql:/bin/sh
operator:x:37:37:Operator:/var:/bin/sh
list:x:38:38:Mailing List Manager:/var/list:/bin/sh
irc:x:39:39:ircd:/var/run/ircd:/bin/sh
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats/gnats-db:/bin/sh
mysql:x:100:103:MySQL Server:/var/lib/mysql:/bin/false
postfix:x:102:65534:Postfix Mailsystem:/var/spool/postfix:/bin/false
knoppix:x:1000:1000:Knoppix User:/home/knoppix:/bin/bash
nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
sshd:x:103:65534:SSH Server:/var/run/sshd:/bin/false
partimag:x:104:65534::/home/partimag:/bin/false
bind:x:106:108::/var/cache/bind:/bin/false
sslwrap:x:107:1001::/etc/sslwrap:/bin/false
clamav:x:101:101::/var:/bin/false
ntop:x:110:110::/var/lib/ntop:/bin/false
uml-net:x:111:111::/home/uml-net:/bin/false
captive:x:105:65534::/var/lib/captive:/bin/false
root@ttyp0[etc]# cat shadow
root:*:11456:0:99999:7:::
daemon:*:11453:0:99999:7:::
bin:*:11453:0:99999:7:::
sys:*:11453:0:99999:7:::
sync:*:11453:0:99999:7:::
games:*:11453:0:99999:7:::
man:*:11453:0:99999:7:::
lp:*:11453:0:99999:7:::
mail:*:11453:0:99999:7:::
news:*:11453:0:99999:7:::
uucp:*:11453:0:99999:7:::
proxy:*:11453:0:99999:7:::
majordom:*:11453:0:99999:7:::
postgres:*:11453:0:99999:7:::
www-data:*:11453:0:99999:7:::
backup:*:11453:0:99999:7:::
msql:*:11453:0:99999:7:::
operator:*:11453:0:99999:7:::
list:*:11453:0:99999:7:::
irc:*:11453:0:99999:7:::
gnats:*:11453:0:99999:7:::
nobody:*:11453:0:99999:7:::
knoppix:*:11593:0:99999:7:::
mysql:!:11550:0:99999:7:::
postfix:!:11678:0:99999:7:::
sshd:!:11864:0:99999:7:::
partimag:!:11916:0:99999:7:::
bind:!:12141:0:99999:7:::
sslwrap:!:12187:0:99999:7:::
clamav:!:12300:0:99999:7:::
ntop:!:11654:0:99999:7:::
uml-net:!:12405:0:99999:7:::
captive:!:12426:0:99999:7:::
does that look correct? - I don't see my login there tho, john.
Thanks
Back to top
View user's profile Send private message
Taladar
Guru
Guru


Joined: 09 Oct 2004
Posts: 458
Location: Bielefeld, Germany

PostPosted: Thu Oct 14, 2004 5:51 pm    Post subject: Reply with quote

On my system every User with a password (root and my user) have a password hash instead of the * in the second column in /etc/shadow (colums are separated by : in /etc/passwd and /etc/shadow).

You might want to boot the live cd, chroot to your system and set a root password with "passwd" like you did during the original installation.
You can add your user again using useradd (see installation manual) but be careful not to use the parameter that copies the content of the skeleton directory (the default user home-directory) since this might overwrite some of your files. After that you should be able to login normally.
Back to top
View user's profile Send private message
johntramp
Guru
Guru


Joined: 03 Feb 2004
Posts: 457
Location: New Zealand

PostPosted: Thu Oct 14, 2004 6:55 pm    Post subject: Reply with quote

ok, but seing as the accounts were somehow removed, will that mean that all the misc users will be bung aswell, or have those not been affected?
Back to top
View user's profile Send private message
Taladar
Guru
Guru


Joined: 09 Oct 2004
Posts: 458
Location: Bielefeld, Germany

PostPosted: Thu Oct 14, 2004 7:39 pm    Post subject: Reply with quote

I would guess you (through etc-update) somehow replaced your files with a standard version like the one installed during the installation of gentoo so every user account added later is likely to be lost.
Back to top
View user's profile Send private message
fcgreg
Apprentice
Apprentice


Joined: 17 May 2003
Posts: 264
Location: California, USA

PostPosted: Sun Oct 17, 2004 9:26 am    Post subject: Undoubtedly Reply with quote

Taladar wrote:
I would guess you (through etc-update) somehow replaced your files with a standard version like the one installed during the installation of gentoo so every user account added later is likely to be lost.

This is probably exactly what you did. Depending on what you upgraded, some packages (like "baselayout") can contain files that you DON'T want to blindly accept. For example, I think baselayout includes default /etc/password, /etc/group, and /etc/fstab files. Many users that have accidentally auto-merged those files have found themselves locked out of the system (or worse, a broken system).

If this is the case, try the following to resolve it:
  • First, do as others have suggested. Boot to a LiveCD and restore your original /etc/password, /etc/fstab, and any other core files that might have been overwritten.
  • Secondly, don't use "etc-update" any more. Or, if you do, be VERY CAREFUL. A much better and safer replacement to etc-update is "dispatch-conf". I suggest using it with RCS (for archive backups) and an archive-directory. See the following for more info:

https://forums.gentoo.org/viewtopic.php?p=1060361#1060361
And here:
https://forums.gentoo.org/viewtopic.php?p=1428536#1428536
_________________
Greg T.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum