Strange trouble with ntpd account

Eugene Grosbein eugen at grosbein.net
Sun Nov 10 11:40:25 UTC 2019


10.11.2019 16:28, BERTRAND Joël wrote:
> 	Hello,
> 
> 	Yesterday, I have rebooted my diskless workstation running FreeBSD
> 12.0-RELEASE-p10. I have seen that ntpd refuses to start :
> 
> root at pythagore:/etc # /etc/rc.d/ntpd start
> Starting ntpd.
> su: unknown login: ntpd
> /etc/rc.d/ntpd: WARNING: failed to start ntpd
> root at pythagore:/etc #
> 
> 	indeed :
> 
> root at pythagore:/var/db/ntp # ls -al
> total 16
> drwxr-xr-x   2 123   ntpd    512 Mar 20  2019 .
> drwxr-xr-x  22 root  wheel  1024 Oct 22 19:01 ..
> -rw-r--r--   1 root  wheel     8 Mar 20  2019 ntpd.drift
> -rw-r--r--   1 root  ntpd      4 Mar 20  2019 ntpd.pid
> 
> 	Please note user 123 instead of user ntpd.
> I have tried to create a new file and change owner to ntpd without success :
> 
> root at pythagore:/var/db/ntp # touch toto
> root at pythagore:/var/db/ntp # chown ntpd toto
> chown: ntpd: illegal user name
> 
> 	I don't understand why ntpd user is illegal as this account exists in
> /etc/master.passwd :
> # $FreeBSD: releng/12.0/etc/master.passwd 337882 2018-08-15 23:18:34Z brd $
> #
> root:$6$mNlwOa.XAsUQF0bo$RCxDWSK0Hc2HGWkT5f46R6zjRhfgKhiA8IGKbM9KkILUACC0fLnKf3jABGiHSxRLSJH/.SXXsjaZJi30.CGR21:0:0::0:0:Charlie
> &:/root:/bin/csh
> toor:*:0:0::0:0:Bourne-again Superuser:/root:
> daemon:*:1:1::0:0:Owner of many system processes:/root:/usr/sbin/nologin
> ...
> www:*:80:80::0:0:World Wide Web Owner:/nonexistent:/usr/sbin/nologin
> ntpd:*:123:123::0:0:NTP Daemon:/var/db/ntp:/usr/sbin/nologin

The system does not use text file /etc/master.passwd but binary files /etc/pwd.db and /etc/swd.db
and yours are out-of-sync with master.passwd for some reason.

Just re-generate binary files from /etc/master.passwd and pwd_mkdb(8) manual page's
EXAMPLE section suggests:

/usr/sbin/pwd_mkdb -p /etc/master.passwd




More information about the freebsd-hackers mailing list