How to add a user to a group in FreeBSD
pw
is the command you are looking for. To add user klaatu
to the group foo
, do:
pw groupmod foo -m klaatu
Here is the FreeBSD handbook page on the subject. It's an easy and informative read: Users and Basic Account Management
Wheel is famous for FreeBSD, if you want to need to use su command, you need to be member of wheel group, So pw groupadd get a groupName and -m get members of your group.Old style of the following command you needed to extra command.
pw groupadd wheel -m mohsen,ali,john,Hilary,Kate