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

Tags: , ,
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.

No Responses

Leave a Reply

*


http://blog.csatpk.com/wp-content/plugins/wp-monalisa/icons/wpml_bye.gif 
http://blog.csatpk.com/wp-content/plugins/wp-monalisa/icons/wpml_good.gif 
http://blog.csatpk.com/wp-content/plugins/wp-monalisa/icons/wpml_negative.gif 
http://blog.csatpk.com/wp-content/plugins/wp-monalisa/icons/wpml_scratch.gif 
http://blog.csatpk.com/wp-content/plugins/wp-monalisa/icons/wpml_wacko.gif 
http://blog.csatpk.com/wp-content/plugins/wp-monalisa/icons/wpml_yahoo.gif 
http://blog.csatpk.com/wp-content/plugins/wp-monalisa/icons/wpml_cool.gif 
http://blog.csatpk.com/wp-content/plugins/wp-monalisa/icons/wpml_heart.gif 
http://blog.csatpk.com/wp-content/plugins/wp-monalisa/icons/wpml_rose.gif 
http://blog.csatpk.com/wp-content/plugins/wp-monalisa/icons/wpml_smile.gif 
http://blog.csatpk.com/wp-content/plugins/wp-monalisa/icons/wpml_whistle3.gif 
http://blog.csatpk.com/wp-content/plugins/wp-monalisa/icons/wpml_yes.gif 
http://blog.csatpk.com/wp-content/plugins/wp-monalisa/icons/wpml_cry.gif 
http://blog.csatpk.com/wp-content/plugins/wp-monalisa/icons/wpml_mail.gif 
http://blog.csatpk.com/wp-content/plugins/wp-monalisa/icons/wpml_sad.gif 
http://blog.csatpk.com/wp-content/plugins/wp-monalisa/icons/wpml_unsure.gif 
http://blog.csatpk.com/wp-content/plugins/wp-monalisa/icons/wpml_wink.gif