Re: How to add FreeBSD users/groups with whitespaces in the name, so NFSv4 and SAMBA can use them?

From: Rick Macklem <rick.macklem_at_gmail.com>
Date: Sun, 15 Mar 2026 23:09:29 UTC
On Sun, Mar 15, 2026 at 2:45 AM Aurélien Couderc
<aurelien.couderc2002@gmail.com> wrote:
>
> Both SAMBA and NFSv4 have to deal with user and group names with
> <space> in their strings.
> Common example is the Windows/OSX "Domain Users".
>
> Is there any solution in FreeBSD pw to add such groups and users?
> Because pw groupadd group -n 'Domain_Users' -g 2016029 does not work.
With an editor.
I used
# vipw
- to add a user with whitespace in the name
# passwd "try useru"
- to set it's password
# ed /etc/group
- to add a line for a group with whitepace in the name

They work for the getpwent/getgrent library calls and I can
login as the user.

Seems to work for local file databases. I have no idea w.r.t. LDAP.

rick

>
> Aurélien
> --
> Aurélien Couderc <aurelien.couderc2002@gmail.com>
> Big Data/Data mining expert, chess enthusiast
>