SSh user key

<< Click to Display Table of Contents >>

Navigation:  Managing Syncplify.me Server! > REST API > Admin API > Utility Functions >

SSh user key

Manages/creates/gets information about SSH user keys.

 

Request

Method

URL

POST

/smserver-default/sms.SSHuserKey

RAW

POST /smserver-default/sms.SSHuserKey HTTP/1.1

Cache-Control: no-cache

Connection: Keep-Alive

Pragma: no-cache

Content-Type: application/json; charset=UTF-8

Accept: */*

Authorization: Bearer XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX

 

[

       {

           "pki" : "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC3fzy0bLfWKsDo/z8vn6VTxF1JsqGTB6N4vEAeDKCSV7bPgdkK5DjWOE/yGbAGPPXfwy0/+ivNUpFBeqP3trlDmqj3BEg8myx7L6pYNmbyLYY1AU1Mu7uVfcT3pYgCssotEz2zizW4ooPapufsX3qhHq+Vc7IiuO3XxNALCmvNc3ME6PuEF7aYin9BenXHlKi3NWNMv4UYvf9RJ9ogcoZ/r5TqQ5PGlUMD3dLRPTXD0e8IIPyNMWRlZnaMAJEwK0i5R\n"

       }

]

Explained

"Command": "info"

 

Retrieves meta-information about a user's key-pair.

 

Response

Method

URL

RAW

Accept-Encoding: synlz,gzip

Content-Type: application/json; charset=UTF-8

 

 

{"result":[

{

       "PKI" : "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC3fzy0bLfWKsDo/z8vn6VTxF1JsqGTB6N4vEAeDKCSV7bPgdkK5DjWOE/yGbAGPPXfwy0/TyftgMgY3EA0Z5SwhALSWaOd2/HjRetPYHnv6FCA3Zs82H/6ugbreiW+LPLx8zL11qLQr5uW5Tf5ZFgqzHM+ivNUpFBeqP3trlDmqj3BEg8myx7L6pYNmbyLYY1AU1Mu7uVfcT3pYgCssotEz2zizW4ooPapufsX3qhHq+Vc7IiuO3XxNALCmvNc3ME6PuEF7aYin9BenXHlKi3NWNMv4UYvf9RJ9ogcoZ/r5TqQ5PGlUMD3dLRPTXD0e8IIPyNMWRlZnaMAJEwK0i5R\n",

       "Hash" : "97c9d0f5e9555af426fa6a9ddd7afb302d1fa3c0",

       "KeyLength" : "2048"

   }

],"id":772674711}

Explained

Returns the full user key as well as:

Hash: a unique fingerprint that identifies the user key itself.

KeyLength: the length (or equivalent length) of the key, already in string format

 

 

OR

 

Request

Method

URL

POST

/smserver-default/sms.SSHuserKey

RAW

POST /smserver-default/sms.SSHuserKey HTTP/1.1

Cache-Control: no-cache

Connection: Keep-Alive

Pragma: no-cache

Content-Type: application/json; charset=UTF-8

Accept: */*

Authorization: Bearer XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX

 

[

{

           "command" : "generate",

           "ABits" : 2048,

           "APass" : "",

           "AFilename" : "Help.rsa"

       }

]

Explained

"Command": "generate"

 

Generates a key-pair for PKI auth of a user profile.

 

Response

Method

URL

RAW

Accept-Encoding: synlz,gzip

Content-Type: application/json; charset=UTF-8

 

 

{"result":[

{

       "Filename" : "Help.rsa",

       "bits" : 2048,

       "passwordProtected" : false,

       "PrivateKey" : "-----BEGIN RSA PRIVATE KEY-----\r\nMIIEowIBAAKCAQEAt388tGy31irA6P8/L5+lU8RdSbKhkwejeLxAHgygkle2z4HZ\r\nCuQ41jhP8hmwBjz138MtP08n7YDIGNxANGeUsIQC0lmjndvx40XrT2B57+hQgN2b\r\nPNh/+roG63olvizy8fMy9dai0K+bluU3+WRYKsxzPorzVKRQXqj97a5Q5qo9wRIP\r\nJssey+qWDZm8i2GNQFNTLu7lX3E96WIArLKLRM9s4s1uKKD2qbn7F96oR6vlXOyI\r\nrjt18TQCwprzXNzBOj7hBe2mIp/QXp1x5SotzVjTL+FGL3/USfaIHKGf6+U6kOTx\r\npVDA93S0T01w9HvCCD8jTFkZWZ2jACRMCtIuUQIEAAEAAQKCAQATvrE9iOVPOlJ/\r\nv9eAvGEB3oNbRsl0FMJWX4tWsG0m0iFtur8sGNq00mJn3rO+OBkM9ueLhGz7dXwS\r\nkMCn4u1xAQN8twCQH/arSf7ED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pzRRsvpqJPbM7wKwFfit9choXAt3DZEIKIc8nJY3dR+B2siEPdSD4\r\nD4mT5G1//T8InUmk6UbMp6ty3IrntHdlQyh/cMSAQLMYndsQ6R3D\r\n-----END RSA PRIVATE KEY-----\r\n",

       "PublicKey" : "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC3fzy0bLfWKsDo/z8vn6VTxF1JsqGTB6N4vEAeDKCSV7bPgdkK5DjWOE/yGbAGPPXfwy0/TyftgMgY3EA0Z5SwhALSWaOd2/HjRetPYHnv6FCA3Zs82H/6ugbreiW+LPLx8zL11qLQr5uW5Tf5ZFgqzHM+ivNUpFBeqP3trlDmqj3BEg8myx7L6pYNmbyLYY1AU1Mu7uVfcT3pYgCssotEz2zizW4ooPapufsX3qhHq+Vc7IiuO3XxNALCmvNc3ME6PuEF7aYin9BenXHlKi3NWNMv4UYvf9RJ9ogcoZ/r5TqQ5PGlUMD3dLRPTXD0e8IIPyNMWRlZnaMAJEwK0i5R\n",

       "fingerprint" : "97c9d0f5e9555af426fa6a9ddd7afb302d1fa3c0"

   }

],"id":772674711}

Explained

Returns:

PrivateKey: the user's private key (MUST be given to the user that needs to authenticate)

PublicKey: a copy of the the user's public key that is stored in the database

Hash: a unique fingerprint that identifies the user key itself.

bits: the length (or equivalent length) of the key, already in string format