mmctl requires authentication, even if you’re on the same server as the Mattermost application server is running, but you can circumvent the username/password authentication by using local socket based authentication, which basically means that you can connect internally to the Mattermost server, without the extra need to authenticate yourself.
In order to do that, you would have to add the --local flag to mmctl and you will need to enable the local authentication mode and restart your Mattermost server for the changes to become active.
To enable local mode, open your Mattermost server’s config.json file and search for EnableLocalMode which most likely is set to false in your environment. Change it to true, restart the server and the mmctl command from above (with the additional --local flag added) should work now.
If you’re using a docker deployment, you will have to use the environment variable MM_SERVICESETTINGS_ENABLELOCALMODE instead of modifying the config.json directly.
I enablelocalmode true after your suggestion restarted the server and still get an error
/opt/mattermost/bin/mmctl user create --email jarvis.cabarcas@jhsmiami.org, --username jcabarcas --password cab-J00@ --system-admin --local
Error: owner of the file “/var/tmp/mattermost_local.socket” must be the same user running mmctl
You should be able to create a POSIX user group that contains the mattermost user and your user account and make it thr group owner of /var/tmp/mattermost_local.socket