You are not logged in.

#1 2012-10-07 21:56:10

esuhl
Member
From: UK
Registered: 2009-09-16
Posts: 75

[SOLVED] /etc/passwd and /etc/shadow -- pwck shows missing groups

I recently found out about the pwck and grpck commands to check for errors/inconsistencies in the passwd, group, shadow and gshadow files...  grpck returns no errors, but pwck returns this:

user 'avahi': no group 84
user 'postgres': no group 88
user 'ntp': no group 87
pwck: no changes

These are the relevant lines from /etc/passwd:

avahi:x:84:84:Avahi daemon:/:/bin/false
postgres:x:88:88:PostgreSQL user:/var/lib/postgres:/bin/bash
ntp:x:87:87:Network Time Protocol:/var/lib/ntp:/bin/false

There are lines for those users in /etc/shadow... but...  I'm not sure what I need to do to fix the problem.

I think I understand enough, now, to maintain the files in future, but would anyone know I can fix this?

Last edited by esuhl (2012-10-08 20:22:05)

Offline

#2 2012-10-07 22:02:26

2ManyDogs
Member
Registered: 2012-01-15
Posts: 1,759

Re: [SOLVED] /etc/passwd and /etc/shadow -- pwck shows missing groups

I don't know how to fix the errors, but I'm really curious about why you decided to run those commands. Were you having a problem you thought might be ralated to groups and/or passwords? What are groups 84, 97, and 88?

Last edited by 2ManyDogs (2012-10-07 22:02:36)

Offline

#3 2012-10-07 22:42:30

teateawhy
Member
From: GER
Registered: 2012-03-05
Posts: 1,078
Website

Re: [SOLVED] /etc/passwd and /etc/shadow -- pwck shows missing groups

It is important the groups permissions on your filesystem are consistent with the /etc/ configuration, too.
Find out what files are owned by the users 'avahi' and others by using the find command:
find / -uid insertuidhere
find / -gid insertgidhere

Offline

#4 2012-10-07 22:51:12

graysky
Member
From: The worse toilet in Scotland
Registered: 2008-12-01
Posts: 8,818
Website

Re: [SOLVED] /etc/passwd and /etc/shadow -- pwck shows missing groups

Cool, I learned something. Thanks OP.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#5 2012-10-07 23:02:51

esuhl
Member
From: UK
Registered: 2009-09-16
Posts: 75

Re: [SOLVED] /etc/passwd and /etc/shadow -- pwck shows missing groups

2ManyDogs wrote:

I don't know how to fix the errors, but I'm really curious about why you decided to run those commands. Were you having a problem you thought might be ralated to groups and/or passwords? What are groups 84, 97, and 88?

Ha!  Well... when I started using Arch I really didn't know much about Linux and I an update providing some .pacnew files (/etc/group, gshadow, passwd, shadow) and... well...  I don't know what I did, but I think it was probably not what I should have done(!).  I used grpck in the past and got no errors and it suddenly occurred to me today that there should be an equivalent for checking /etc/passwd... so that's why I just ran the commands now.  Everything seems to be working, however...

I don't have an entry for groups 84, 87 and 88 in my /etc/group file...  Hmmm...

I tried running this command to find any files associated with that group, but only get the following:

[root@i7pc tim]# find / -gid 88
find: `/run/user/1000/gvfs': Permission denied
find: `/proc/1806/task/1806/fd/5': No such file or directory
find: `/proc/1806/task/1806/fdinfo/5': No such file or directory
find: `/proc/1806/fd/5': No such file or directory
find: `/proc/1806/fdinfo/5': No such file or directory

I get similar output for the other groups, so... can I just delete them from /etc/passwd and /etc/shadow?

I notice I have the avahi package installed, however, and group 84 relates to user 'avahi'... so...  surely I need the avahi user...?

Last edited by esuhl (2012-10-07 23:09:30)

Offline

#6 2012-10-07 23:16:15

esuhl
Member
From: UK
Registered: 2009-09-16
Posts: 75

Re: [SOLVED] /etc/passwd and /etc/shadow -- pwck shows missing groups

teateawhy wrote:

It is important the groups permissions on your filesystem are consistent with the /etc/ configuration, too.
Find out what files are owned by the users 'avahi' and others by using the find command:
find / -uid insertuidhere
find / -gid insertgidhere

Thanks -- I didn't see your post till after I written the reply above!

I also tried the find command with the relevant UIDs and again got just a "permission denied" message for /run/user/1000/gvfs and four "No such file or directory" messages relating to a subdirectory of /proc (which I assume isn't anything to worry about).  The only exception is UID 87, which also lists a couple of files in /var:

[root@i7pc tim]# find / -uid 87
find: `/run/user/1000/gvfs': Permission denied
/var/lib/ntp
/var/lib/ntp/ntp.drift
find: `/proc/1861/task/1861/fd/5': No such file or directory
find: `/proc/1861/task/1861/fdinfo/5': No such file or directory
find: `/proc/1861/fd/5': No such file or directory
find: `/proc/1861/fdinfo/5': No such file or directory

So... presumably that means I can get rid of the entries in /etc/passdw and /etc/shadow for "avahi" and "postgres"...?  Is that right?  But what about the "ntp" user/group...?

Thanks

Offline

#7 2012-10-08 00:04:51

skunktrader
Member
From: Brisbane, Australia
Registered: 2010-02-14
Posts: 1,323

Re: [SOLVED] /etc/passwd and /etc/shadow -- pwck shows missing groups

You probably just need to add these

avahi:x:84:
ntp:x:87:
postgres:x:88:

to /etc/group

Offline

#8 2012-10-08 00:10:51

2ManyDogs
Member
Registered: 2012-01-15
Posts: 1,759

Re: [SOLVED] /etc/passwd and /etc/shadow -- pwck shows missing groups

Skuntrader, do you know what these groups are, and why they should be added? I'm really curious about this, not trying to be obnoxious.

Offline

#9 2012-10-08 20:21:24

esuhl
Member
From: UK
Registered: 2009-09-16
Posts: 75

Re: [SOLVED] /etc/passwd and /etc/shadow -- pwck shows missing groups

skunktrader wrote:

You probably just need to add these

avahi:x:84:
ntp:x:87:
postgres:x:88:

to /etc/group

Fantastic!  It's that easy!  I wasn't sure how /etc/gshadow would cope without the corresponding entries, but I ran grpck and it prompted me to add those groups to gshadow.  And now neither grpck nor pwck return any errors.  Thanks very much!

2ManyDogs wrote:

Skuntrader, do you know what these groups are, and why they should be added? I'm really curious about this, not trying to be obnoxious.

Postgres relates to the PostgreSQL package, and the other groups correspond to their package names.  The only reason they needed to be added is (presumably) because I deleted them in error at some point (by screwing up the merging of .pacnew files).  You shouldn't ordinarily need to add them, I don't think.

Anyway, cheers all -- I'll mark this solved!

Offline

Board footer

Powered by FluxBB