Results 1 to 2 of 2

Thread: How to upload a ssh key?

  1. #1

    Question How to upload a ssh key?

    Hi forum,

    I try to upload a self generated sshkey (ssh-rsa) with the fingerprint "96:56:5b:1c:f3:d6:89:fb:ea:1a:48:f2:7d:5c:94: a5 ", 2048 bits and the following request

    Code:
    curl -X POST -H "Authorization: Bearer f3tVE00g4R3GUIgU3jH2" --data "account=580.........264&keydata=ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCob...............zMeOZ&comment=test"  https://api.hidrive.strato.com/2.1/user/key
    The response is the following

    Code:
    {"comment":"test","added":1477533333,"fingerprint":"e6:cc:e6:a5:c9:6c:0f:bc:5b:84:63:e1:d7:1d:43:17","type":"ssh-rsa","id":"148...........2","keybits":488}
    So the protocol and POST works fine. But the key is misinterpreted. the fingerprints and key bits are different.

    If I upload the sshkey using the Webinterface or playground everything works as expected.

    Does anybody have any hints what I am doing wrong?

    Thx.

  2. #2
    this might have to do with the spaces in your data string.

    ...keydata=ssh-rsa AA...
    Did you try --data-urlencode or --form for the curl?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •