2

I'm trying to sudo chown -R vagrant:vagrant .ssh. From this answer, I was told to make sure the group exists, so I have. My output from dscl . list /Groups PrimaryGroupID lists vagrant as one of the groups, so why can't I chown?

ekad
  • 14,436
  • 26
  • 44
  • 46
Alexander Kleinhans
  • 5,950
  • 10
  • 55
  • 111

1 Answers1

0

I found that I wasn't able to use chown or chgrp, to change the group, until I filled out the following fields for the group using dscl:

AppleMetaNodeLocation:
GeneratedUID: 
GroupMembership:
Password:
PrimaryGroupID: 
RealName:
RecordName:
RecordType: dsRecTypeStandard:Groups

These appear to be the minimum required keys to fill out, before one can use the group with chown or chgrp.

I just looked up the record of the group that currently owned the file with dscl ("wheel"), and filled in what was missing for the desired group (Password, RealName, PrimaryGroupID) until chown allowed me to change the file's group to that group.

Unfortunately, there is one enigmatic record (GroupMembers, not GroupMembership which lists the members of the group) of the wheels record that I can't figure out how to generate or what it means, but chown let me change the group without having this field filled out.

drpooper
  • 71
  • 1
  • 2