Chef: knife user create doesn't actually allow users to be created (w/o pivotal)

Created on 3 Mar 2016  路  5Comments  路  Source: chef/chef

Description

knife provides a command knife user create however it will fail even for org admins because afaik the only way to create users is with chef-server-ctl user-create command

Chef Version

Going back at least a few chefdk versions

$ chef -v
Chef Development Kit Version: 0.11.2
chef-client version: 12.7.2
berks version: 4.2.0
kitchen version: 1.5.0

Replication Case

knife user create knife_user_test knife_user_test knife_test knife_create [email protected] test123
ERROR: You authenticated successfully to https://api.opscode.com/organizations/i_watch_dora_the_exlorer as alexv_trash01 but you are not authorized for this action
Response:  missing create permission

Expected outcome

Perhaps one of the following would be a valid solution

  • update the help file to reflect that command needs special key
  • remove knife user create command
Chef Server

All 5 comments

Created a brand new org for testing, and the user creating fails with:

knife user create knife_user_test knife_user_test knife_test knife_create [email protected] test123

ERROR: You authenticated successfully to https://api.chef.io/organizations/av_user_creation_test as alexv but you are not authorized for this action
Response:  missing create permission

This should probably be discussed in a broader context. Most of the user-related commands in knife (also knife configure) have been non-functional. The new server-admins group exists to try and fix some of that, but only covers knife user edit right now I think?

This command has only ever worked on open source chef server and never on private/hosted/enterprise/chef server 12.

Also a dup of numerous other reports. Probably wrong repo to report this in since there's no Server API to hit in order to modify this command to work.

Assuming a user is part of the server admins group on the server, this command should know work, as of the release of Chef server 12.4.1, which was back in Feb. This should be verified, but once it is, this can be closed. (Note that if a user is NOT part of the server admins group, this command will always fail, due to how permissions work on Chef server 12+).

Relevant docs here: https://docs.chef.io/knife_user.html (also links to docs on server admins)

knife user commands are useless at least from the standpoint of the hosted chef, for anybody that needs it, you should do the following:

  • Register the account at https://manage.chef.io/signup
  • Activate the account via the email received
  • Invite to the organization needed
  • Accept the invitation
  • Add the account to whatever security groups needed
Was this page helpful?
0 / 5 - 0 ratings