Error in password file?

Rick Stevens rstevens at corp.alldigital.com
Fri Feb 10 17:18:37 UTC 2012


On 02/10/2012 08:50 AM, Marvin Kosmal wrote:
> On 2/9/12, Rick Stevens<rstevens at corp.alldigital.com>  wrote:
>> On 02/09/2012 03:01 PM, Rick Stevens wrote:
>>> On 02/09/2012 01:38 PM, Marvin Kosmal wrote:
>>>> On 2/9/12, Rick Stevens<rstevens at corp.alldigital.com>  wrote:
>>>>> On 02/09/2012 09:31 AM, Marvin Kosmal wrote:
>>>>>> On 2/9/12, Aaron Konstam<akonstam at sbcglobal.net>  wrote:
>>>>>>> On Wed, 2012-02-08 at 14:43 -0800, Marvin Kosmal wrote:
>>>>>>>> On 2/8/12, don fisher<hdf3 at comcast.net>  wrote:
>>>>>>>>> When I execute pwck to verify integrity of password files and
>>>>>>>>> received
>>>>>>>>> the following:
>>>>>>>>>
>>>>>>>>> sudo pwck
>>>>>>>>> user 'adm': directory '/var/adm' does not exist
>>>>>>>>> user 'uucp': directory '/var/spool/uucp' does not exist
>>>>>>>>> user 'gopher': directory '/var/gopher' does not exist
>>>>>>>>> user 'avahi-autoipd': directory '/var/lib/avahi-autoipd' does not
>>>>>>>>> exist
>>>>>>>>> user 'oprofile': directory '/home/oprofile' does not exist
>>>>>>>>> user 'saslauth': directory '/var/empty/saslauth' does not exist
>>>>>>>>> user 'pulse': directory '/var/run/pulse' does not exist
>>>>>>>>> invalid password file entry
>>>>>>>>>
>>>>>>>>> How should this be fixed?
>>>>>>>>>
>>>>>>>>> Don
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>>
>>>>>>>>
>>>>>>>> Hi
>>>>>>>>
>>>>>>>> I don't believe every user has a directory..
>>>>>>>>
>>>>>>>> I think you are "Good to GO!"
>>>>>>>>
>>>>>>>> Marvin
>>>>>>>
>>>>>>> I don't know if you are good to go but when I run: sudo pwck
>>>>>>> on my machine except the last entry is:
>>>>>>> pwck: no changes
>>>>>>>
>>>>>>> instead of: invalid password file entry
>>>>>>>
>>>>>>> so that is the output that would worry me. It seems you have an
>>>>>>> invalid
>>>>>>> entry in the passwd file. It would be nice if the program gave you a
>>>>>>> hint which entry it is complaining about.
>>>>>>>
>>>>>>> --
>>>>>>> =======================================================================
>>>>>>>
>>>>>>> Of course you can't flap your arms and fly to the moon. After a while
>>>>>>> you'd run out of air to push against.
>>>>>>> =======================================================================
>>>>>>>
>>>>>>> Aaron Konstam telephone: (210) 656-0355 e-mail: akonstam at sbcglobal.net
>>>>>>>
>>>>>>
>>>>>>
>>>>>> HI
>>>>>>
>>>>>> I gave my answer based on three boxes I have they yield similar
>>>>>> results. Not all users will have a directory.
>>>>>>
>>>>>> I stand by my answer..
>>>>>
>>>>> Yes, users do NOT have to have a home directory (especially users that
>>>>> are primarily there as "owners" of daemons and such and have a shell
>>>>> of /sbin/nologin).
>>>>>
>>>>> The "invalid password file entry" error probably indicates a blank line
>>>>> at the end of either /etc/passwd or /etc/shadow, so that's the first
>>>>> place I'd look. Try
>>>>>
>>>>> $ sudo vipw -p (edits /etc/passwd safely)
>>>>> $ sudo vipw -s (edits /etc/shadow safely)
>>>>>
>>>>> and check to make sure there aren't any blank lines in the files. Not
>>>>> sure if pwck chokes on NIS-style entries (e.g. a username of "+")
>>>>> ----------------------------------------------------------------------
>>>>> - Rick Stevens, Systems Engineer, AllDigital ricks at alldigital.com -
>>>>> - AIM/Skype: therps2 ICQ: 22643734 Yahoo: origrps2 -
>>>>> - -
>>>>> - On a scale of 1 to 10 I'd say... oh, somewhere in there. -
>>>>> ----------------------------------------------------------------------
>>>>>
>>>>
>>>> Thanks for the come back..
>>>>
>>>> I did the vipw -p and vipw -s and they all look identical ..No blank
>>>> lines..
>>>
>>> The question is are there any blank lines at the end? That can be
>>> difficult to see in an editor. When using vipw, try entering ":$"
>>> (without the quotes, just colon-dollarsign). That should put you on
>>> the last line of the file, which should contain data. If that's a
>>> blank line, there's your answer.
>>>
>>> Using "cat" can also tell you something. If you (as root) do "cat
>>> /etc/passwd", make sure that the command prompt appears IMMEDIATELY
>>> after the data. If there's a blank line between the output and the
>>> prompt, you have a blank line at the end of the file.
>>>
>>> Samples:
>>> Good (no blank line at end of file):
>>> [root at prophead server]# cat /tmp/wook
>>> 1
>>> 2
>>> 3
>>> 4
>>> [root at prophead server]#
>>>
>>> Bad (blank line at end of file):
>>> [root at prophead server]# cat /tmp/wook
>>> 1
>>> 2
>>> 3
>>> 4
>>>
>>> [root at prophead server]# vi /tmp/wook
>>>
>>> ("/tmp/wook" is just a scratch filename I used)
>>
>> Additional note, I just used vipw to add a blank line to the end of
>> /etc/passwd and got the same error the OP got when I ran pwck, but with
>> a "delete line?" prompt.  I didn't accept that and used vipw to delete
>> the blank and pwck ran clean.
>> ----------------------------------------------------------------------
>> - Rick Stevens, Systems Engineer, AllDigital    ricks at alldigital.com -
>> - AIM/Skype: therps2        ICQ: 22643734            Yahoo: origrps2 -
>> -                                                                    -
>> -       A squeegee, by any other name, wouldn't sound as funny.      -
>> ----------------------------------------------------------------------
>> --
>
>
> Hi
>
> I am still getting the no directory thing.
>
> But.  The second time you run pwck it gives the message..
>
> pwck: no changes
>
> So, I am back to my original statement..
>
> OP is "GOOD TO GO"....
>
> I get all those no directories and don't believe they need directories..

No they don't.  Those are the users associated with daemon processes
and they don't have to have a home directory.

If you don't get the "invalid passwd entry" message, then the files are
good.  The "pwck: no changes" indicates that pwck didn't have to do
anything to the file (e.g. deleting a blank line, etc.)
----------------------------------------------------------------------
- Rick Stevens, Systems Engineer, AllDigital    ricks at alldigital.com -
- AIM/Skype: therps2        ICQ: 22643734            Yahoo: origrps2 -
-                                                                    -
-  BASIC is the Computer Science version of `Scientific Creationism' -
----------------------------------------------------------------------


More information about the users mailing list