Created
September 14, 2013 23:15
-
-
Save uolot/6566557 to your computer and use it in GitHub Desktop.
Add SSH key to Bitbucket account from shell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl --user <USER>:<PASSWORD> -X POST https://bitbucket.org/api/1.0/users/<USER>/ssh-keys --data-urlencode "key=<PUBLIC_KEY>" --data-urlencode "label=<LABEL>" |
@josa42, facing same issue. Could you tell how you managed to update ssh keys programatically?
any update on this?
curl -u "<USERNAME>:<PASSWORD>" https://bitbucket.org/api/1.0/users/<USERNAME>/ssh-keys --data-urlencode "key=$(cat /root/.ssh/root.pub)" -data-urlencode "label=my_key"
This will add global keys regardless to repository (if you want write access to your all repositories), bitbucket also provide another option READ permission repository basis (useless unless you want to pull, not push). Unfortunately, there is no option to make WRITE permission for certain repo (correct me, guys if I am mistaken)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Unfortunately this is not working anymore. The API responds with: