Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
groupadd/useradd fail to open files [Solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
asroka
n00b
n00b


Joined: 01 Nov 2002
Posts: 19
Location: Los Angeles, CA USA

PostPosted: Fri Aug 05, 2005 9:38 am    Post subject: groupadd/useradd fail to open files [Solved] Reply with quote

Running hardened with SELinux on x86.

groupadd/useradd both fail at various times with "unable to open group/password/shadow password file" (Not all three, but I have seen each individually.)

I've noticed that sometimes there is a leftover /etc/.pwd.lock file. Manually deleting this doesn't cause any additional problems, but it doesn't fix the issue either.

Can't find anything on google even remotely addressing this. It's wierd. Usually happens when I'm trying to emerge something (The last time was qmail, but it has happened on other packages.) I've worked around it by manually editing the files (Since the users that are created will never logon so SELinux issues don't matter,) but I'd like to have a real solution (In case I need to add an actual user ;-)


Last edited by asroka on Sat Aug 06, 2005 4:05 am; edited 1 time in total
Back to top
View user's profile Send private message
asroka
n00b
n00b


Joined: 01 Nov 2002
Posts: 19
Location: Los Angeles, CA USA

PostPosted: Sat Aug 06, 2005 4:05 am    Post subject: Reply with quote

This was an SELinux issue. At some point I touched one of the files. This caused the file to get locked out.

The solution was this:
restorecon /etc/group
restorecon /etc/passwd
restorecon /etc/shadow

The vexing part is that I couldn't find this anywhere online when I was looking for "unable to open group file" but it was in the O'Reilly SELinux book.

Mental note: editing password files by hand is considered harmful.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security 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