Illegal group name / Permission denied

Mac OS. Using Terminal:

In this lab I’m trying to setup a node1.conf

Enter:
m103-vagrant-env timothydanielson$ sudo chown vagrant:vagrant /var/mongodb/pki/

Result:
chown: vagrant: illegal group name

Trying to trouble shoot, I then tried the next line to see what would happen:
Enter:
m103-vagrant-env timothydanielson$ sudo openssl rand -base64 741 > /var/mongodb/pki/m103-keyfile

Result:
-bash: /var/mongodb/pki/m103-keyfile: Permission denied

I tried to modify the permissions of the private/var/“mongodb”/ and “pki” folders to be read and write everyone, to see if I can force visibility and accessibility for this lab. No one has permission to modify these folders.

Did you create the dir?
If yes who was the owner

sudo mkdir -p /var/mongodb/pki/
sudo chown vagrant:vagrant /var/mongodb/pki/

illegal group name actually means that the group you’re specifying doesn’t exist. You need to either create the group, stop specifying a group, or specify a group that exists

I created the folder using sudo. Also checked from the owners account, who also doesn’t have permission to change the folder.

I’m not specifying a group name in the command. Perhaps there’s something I’m missing, maybe there is a way to launch terminal in a root user level? then if I made those folders, perhaps they would inherit the correct permissions, because highest authority was involved.