How to set users without home directory ?

  • Hello,


    I would like to remove home directory for some users accounts (which are used as service like docker user account), because I've enable "User home directory" in OVM ("Settings" tab of "Acces Rights Management > User"). and I've enable "Home directories" in SMB ("Services > SMB/CIFS") too.


    What is the good way to it in OMV?


    I didn't see option in OMV GUI, then I've manualy modified /etc/passwd file.

    I've tried two way:

    - removing home directory path (username:x:UID:GID:Comment::/usr/sbin/nologin)

    - replacing home directory path by /nonexistent (username:x:UID:GID:Comment:/nonexistent:/usr/sbin/nologin)

    Is there a best way between them?


    I've checked result after updating OMV or creating a new user account, and changes on /etc/passwd file stay present.

    FYI if "User home directory" is disable/enable in OVM ("Settings" tab of "Acces Rights Management > User"), all changes on /etc/passwd file are removed.


    Thank you,

    Chris

  • Use one of these:

    Yes I had done that, but home directories were also created for "nologin" or "false" Shell users accounts when I had enable "User home directory" in OVM ("Settings" tab of "Acces Rights Management > User").


    I've just done a new test right now to see if creating "nologin" or "false" Shell users accounts after enable "User home directory" in OVM, change something, but not, home directories are created for new "nologin" or "false" Shell users accounts.


    FYI my OMV is up to date (5.6.26.-1).

  • I know of no official way to remove a home dir from a user, except editiing /etc/fstab. But omv manages the configuration for users created from the UI which means it will probably set it again.


    if you really need service accounts create them on the ui outside the control of omv.

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!