Creating a System User (like www)

adduser is simple enough but I am unsure about what information to put when adding another user with the same privileges as www

I have looked at the following but still need help:
http://www.freebsd.org/doc/en/books/handbook/users.html

Basically I want to clone the www user with a different name but am unsure of all the settings used. So far I have:

Code:
# adduser
Username: wwwmain
Full name: Apache User for User main
Uid (Leave empty for default): 
Login group [wwwmain]: 
Login group is wwwmain. Invite wwwmain into other groups? []: main
Login class [default]: 
Shell (sh csh tcsh bash rbash nologin) [sh]: nologin
Home directory [/home/wwwmain]: /nonexistent
Use password-based authentication? [yes]: no
Lock out the account after creation? [no]: 
Username   : wwwmain
Password   : <disabled>
Full Name  : Apache User for User main
Uid        : 1015
Class      : 
Groups     : wwwmain main
Home       : /nonexistent
Shell      : /usr/sbin/nologin
Locked     : no
OK? (yes/no): yes
adduser: INFO: Successfully added (wwwmain) to the user database.

Does this look ok?

And what does the following mean when I respond with no:
Use password-based authentication? [yes]: no
 
It looks fine.. You may also want to check out man pw.

Code:
pw adduser wwwmain -g wwwmain -d /nonexistent -s /usr/sbin/nologin -c "Apache user for user main"
group "wwwmain" have to add before; see my test and error


pw adduser wwwmain -g wwwmain -d /nonexistent -s /usr/sbin/nologin -c "Apache user for user main" -N
pw: group `wwwmain' does not exist

pw addgroup help
That should be done before:
pw addgroup -n wwwmain
 
Seriously, I just use vi (which you really should know if you use any kind of 'nix system, from BusyBox to, well, FreeBSD, imo)...

echo "groupname:*:65535:username,username" >> /etc/group

adduser

(follow prompts)

or

vipw

(modify text file)


It's really not that complicated... In fact, vi is kind of elegant... It's enjoyable to use, and surprisingly fit for its common tasks...
 
your are right, vipw can be easier than adduser.
But you have edit it interactive. When you will write a script or just change some with one command line, and you want document also what you have been done, pw ... is better for that.
thanks.
 
group "wwwmain" have to add before; see my test and error


pw adduser wwwmain -g wwwmain -d /nonexistent -s /usr/sbin/nologin -c "Apache user for user main" -N
pw: group `wwwmain' does not exist

pw addgroup help
That should be done before:
pw addgroup -n wwwmain

You can just leave off the -g parameter. pw creates the default group with the same name (at least on 12.1)
pw adduser wwwmain -d /nonexistent -s /usr/sbin/nologin -c "Apache user for user main"
 
Back
Top