3
So I am attempting to create a new user and group, and then change ownership of a directory to that new user/group. However, when I do, chown comes back with an "illegal user name" message.
Here's a simplified shell script that shows what I'm trying to do:
#!/usr/bin/bash
# Create Group
dscl . create /Groups/_jira
dscl . create /Groups/_jira gid 301"
# Create User
dscl . create /Users/_jira
dscl . append /Groups/_jira GroupMembership _jira
# Change Ownership
chown -R _jira:_jira /Some/random/directory
... and the output I get is:
chown: _jira: illegal user name
Am I missing a step? Is it because the username is prefixed with an underscore?
Note: I can list all the existing users and groups and can see the _jira user and _jira group, and also see that the user is assigned to that group.