I'm trying to create a system user in Debian, with no home directory, for use with getmail.
Even though I did:
adduser --system --group --no-create-home getmail
The entry in /etc/passwd is:
getmail:x:122:156::/home/getmail:/usr/sbin/nologin
even though the /home/getmail directory is never created. Why mention a directory that was never created? I was expecting to see the placeholder /nonexistent there, which appears in several entries in /etc/passwd.
Why is the /home/getmail entry made, and if I want the /nonexistent entry instead, do I have to state it explicitly?
/home/someonerestored from a backup and I want to (re)create a user account to use it. What would you suggest in this situation, @FaheemMitha? – Chris Davies Feb 09 '22 at 10:49/home/foodirectory, and the default provided byadduseris fine for most users (andadduser.confprovides configuration to cover some other scenarios). For a system account you either don’t want a home directory, or you want to specify it and it’s not a directory under/home. Even for scenarios such as the Dovecot mail spool,dovecot’s home directory isn’t the spool so it doesn’t matter much, but I don’t think you’d ever want/home/dovecot. – Stephen Kitt Feb 09 '22 at 14:08adduserdoes the right thing by default in most cases for user accounts, butadduser --systemhas a default which is never useful. – Stephen Kitt Feb 09 '22 at 14:10/etc/passwdentry has a home entry that doesn't exist, it is safe to replace/home/getmail(in my case) with/nonexistentby directly editing the/etc/passwdfile? I could delete and recreate the user, but I'm wary of complications (like ifadduserdoesn't recreate the user and group with the same ids) and if I can directly edit, that seems like the simplest option. Thanks in advance. – Faheem Mitha Feb 10 '22 at 09:18