I'm adapting a samba config for a domain server from FreeBSD to OpenBSD, but part of it doesn't appear to be able to work in OpenBSD

The part that needs to be adapted:

add user script = /usr/sbin/pw useradd -n %u -m
#%u is a SMB variable (its the user being added) -m makes a home #directory for the user

delete user script = /usr/sbin/pw userdel -n %u -r
#deletes the user %u and removes their home directory

add group script = /usr/sbin/pw groupadd -n %g
#adds the group, %g, to the system.

delete group script = /usr/sbin/pw groupdel -n %g
#deletes group %g from the system.

add user to group script = /usr/sbin/pw groupmod -n %g -m %u
# APPEND user %u to group %g (note how it adds the user to the #list, does not replace the list with the user)

delete user from group script = /usr/sbin/groupmod -R %u %g
#I have no idea how to implement this in OBSD(this was written for #linux and it doesnt even work there anymore)

add machine script = /usr/sbin/pw useradd -n %u -d /var/lib/nobody -s /usr/bin/false
#pretty self explanatory

I've looked at the man pages for OBSD useradd groupdel ... but they don't seem to allow me to do some of these (namely remove a user from an existing group, or add a user to a group without erasing all other memberships in the group)
Any help would be greatly appreciated.

Reply via email to