Hi, I have figured it out: http://stackoverflow.com/questions/32332045/gitlab-api-add-ssh-key http://unix.stackexchange.com/questions/136894/command-line-method-or-programmatically-add-ssh-key-to-github-com-user-account
# curl -k -X POST -F "private_token=gfr45ffddfdfdxxxxx" -F "title=TestKey1" -F "key=the key from user's .ssh/id_rsa.pub file <[email protected]>" https://yourgitlabserver.com/api/v3/user/keys <https://acnvm017.pbn.bnl.gov/api/v3/user/keys> You can find the root user's private token under profile setting's account. Thanks, Stacey On Wednesday, September 7, 2016 at 10:01:23 AM UTC-4, [email protected] wrote: > > Hi, > > I am using gitlab-ce-8.9.5-ce.0.el6.x86_64.rpm. > > I am trying to add ssh keys to my gitlab server via command line and I am > having issues. > > I know how to add the key via the GitLab UI, but I am trying to automate > it. For example, I have to add about 100 ssh keys. I don't want to have to > do it manually. > > I found an old discussion: > https://groups.google.com/forum/#!msg/gitlabhq/D2ES9aaUWM8/gCDU3G0E01sJ > > At the end of that discussion, it points to this doc: > http://docs.gitlab.com/ce/api/users.html > > I reviewed this doc, but still can't figure out how to add ssh key using > command line. How to use those api? > > Many thanks for your help! > > Stacey > -- You received this message because you are subscribed to the Google Groups "GitLab" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/gitlabhq/e1be4170-16d8-4e9b-9339-9879f653cdfe%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
