UNIX users are usually managed in the well-known passwd file format. The corresponding file usually resides at /etc/passwd
.
Since editing this file by hand is very inconvenient (mostly because of the encrypted passwords), there are tools to edit it, like useradd
(and its wrapper adduser
), and passwd
, which make editing these files very easy.
The format is in fact so practical, that system users aren't the only users which are kept in this format, but other services like dovecot also offer functionality to read users from such a file.
You would think that this is very convenient, as you can use the same set of tools for managing the users of a whole range of services. However, the tools mentioned above seem to be hardwired to work to work on /etc/passwd
(and etc/shadow
if it's in use).
Now I would be surprised, if there isn't a convenient way to edit passwd files, other than /etc/passwd
, but I couldn't find any. How can I do that on a Debian Linux/GNU system?
My concrete problem is, that I want to create a password file for dovecot, according the the format documented here. The most problematic thing is getting the encrypted passwords into it.