How to add users/groups to a FreeBSD System? March 2nd, 2010
You can use the ‘pw’ command to add a user and or group to the FreeBSD System.
The ‘pw’ command is a program that will allow any user with superuser priveledges
to edit and or add users and groups on FreeBSD with ease. It also allows you a way
to standardize modification of adding and removing users and groups.
You will want to be logged in as root and or a user with sudo access.
# pw groupadd adminusers
This would create the group ‘adminusers’ to the machine.
Now say you want to add the users ‘mike’ to the adminusers using pw
# pw useradd mike -s /bin/csh -g adminusers
This command would create the user mike, with a shell of /bin/csh and add it to the adminusers groud.
The user would also have his home directoryu under /home/mike
Now say you want to have this user’s home directory on a different partion, for example /mnt/disk2/home
#pw useradd mike -d /mnt/disk2/home/mike -s /bin/csh/ -g adminusers
Now say that you want to add mike to a secondary group on the system say a group that has been created already called ‘ftpusers’
To do this you would want to do the following
#pw usermod mike -G ftpusers
Say you want to add mike to multiple groups at the same time.
#pw usermod mike -G ftpusers,wwwusers,sales
source here
This entry was posted on Tuesday, March 2nd, 2010 at 9:44 am and is filed under feebsd, linux, Networking. You can follow any responses to this entry through the RSS 2.0 feed.You can leave a response, or trackback from your own site.
