Creation of Application Accounts

I'm trying to create an application account which will only be used for running processes, not for logging into the server. I would like to duplicate the functionality of the application accounts that come with the base install. For example:

Code:
pop:*:68:6::0:0:Post Office Owner:/nonexistent:/usr/sbin/nologin
www:*:80:80::0:0:World Wide Web Owner:/nonexistent:/usr/sbin/nologin

The previous lines were taken from /etc/master.passwd and have an encrypted password of "*". It is my understanding that any encrypted password with a value of "*" will prevent that account from ever authenticating in the system.

How does one go about creating this type of account? I've been creating the account with the standard adduser command and editing the password field in /etc/master.passed then running run pwd_mkdb -p /etc/master.passwd to update the pwd.db and spwd.db files. I know that manually editing the /etc/master.passwd is bad practice and would like to find a more preferable way of obtaining the same results.
 
Something like:
Code:
pw useradd <username> -u <uid> -g <group> -d /nonexistent -s /usr/sbin/nologin
?
 
Back
Top