1

The passwd file entry for a user associated with a service (squeezelite) indicates that user has a home directory (/home/squeezelite). This folder does not exist (and I suspect it never did).

The service is running fine, so my inclination is to modify the passwd file to indicate the user has no home directory. Is there some way to accomplish this with usermod or should I edit the passwd file directly? If the answer is to edit the passwd file, what change should I make? Replace /home/squeezelite with /

0

You can either use @RalfFriedl's answer and use the -d option, which is used mostly with /nonexistent for that case, or you can edit the /etc/passwd file:

Just delete /home/squeezelite:
From something like:

squeezelite:x:1001:1001::/home/squeezelite:

You can either make it:

squeezelite:x:1001:1001:::

or

squeezelite:x:1001:1001::/nonexistent:

You can also use the root directory / for the home directory. However, my top suggestion is to just delete /home/squeezelite from the passwd file. Then the user will have no home directory.

  • Will specifying /nonexistent and /var/nonexistent satisfy shadow.service, which is failing with user 'squeezelite': directory '/home/squeezelite' does not exist. – eponymous Aug 29 '18 at 4:34
  • @eponymous no, it will not. It will still say that the directory does not exist. That is why I suggest the first example, making it squeezelite:x:1001:1001::: – Fanatique Aug 29 '18 at 6:48
  • Interestingly, shadow.service objected to leaving the field blank, so I entered /, which it accepted. Thanks. – eponymous Aug 30 '18 at 4:14
  • I guess Arch doesn't accept that then. For me on Debian 9 it worked. – Fanatique Aug 30 '18 at 6:51
1

From man usermod

-d, --home HOME_DIR

The user's new login directory.

If the old home didn't matter, the new home probably also wouldn't matter, but you could use something like /var/nonexistent to show that the home directory is not needed or supposed to exist.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.