Generate a user's SSH key
POST/api/generate_user_ssh_key/:name
Creates a passphrase-less key pair in the user's own folder on the server and points their profile at it.
Passphrase-less because nothing can type one: the key is used by unattended git operations, and every push and pull authenticates as the user who triggered it. File permissions, and the key's exclusion from the instance repository, are what protect it instead.
Repointing the profile is part of the same call rather than a separate
save, so the new key is in use even if the dialog is closed without
saving. An existing key is refused unless overwrite is set, so a
working key is never replaced by a stray double-click.
Request
Responses
- 200
- 400
- 403
- 404
- 409
- 422
- 500
Successful Response
Unknown key type.
Generating a key for another user requires the Manage users permission.
User not found
A key already exists and overwrite was not set.
Validation Error
ssh-keygen is unavailable on the server, or failed.