Programmatically import users ssh pubkey

Hello all,

I’m running Gitlab CE and I’d like to programmatically import ssh pub keys for my end-users. Is this achievable in any way via API, scripts, backend-tools, etc?

Thanks a lot


I’d recommend checking the API docs for any “maintenance” task, you can manage nearly everything through REST calls.

In your case, it is possible to upload an SSH key for an existing user.

User creation can happen before too.

Keep in mind that the private token used in the request needs an administrative account.

If you prefer to use a client library in a specific language, the Python API library supports that.


1 Like