SSH Keys
When you create a SnapShooter team, we will generate your first SSH key. If you want to use different keys per server/group you can create more.
All keys are 4096 Bits. RSA.
We don't currently support Ed25519, once we see more adoption with big providers like AWS we will add support.
Create Key #
Parameters
string name
optional - Will generate name if not provided (SnapShooter - DateTime)
Example: Acme Server SSH Key
POST /v1/ssh-keys
curl https://api.snapshooter.com/v1/ssh-keys \ -X POST \ --header 'Authorization: Bearer API_TOKEN_HERE' \ -d name="Acme Server SSH Key"
HTTP/2 201{ "data": { "id": 6112330, "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDFdoTkLBMcdUTzTemnGZ675AuCgrsR+zepgKQEQfIL5W6MXOljNpUpMjDye1s9gSzlHCSURaBHdT3JEao30EoZl1ALPbiTtlEXBrQoz8dMbidmJF+HjFKRFHfnz3bEWvym7XQlxM714dlSPNRx5FTH0Z8xMEY4KQqMV9Il4aSR5iF6G5d0YkrATF0RtebwPDz1fNcn8u8Of6ryre1THZAC1dzaDwO7q6V1F9zFCFdVZ+KTb1EzdgzQ1CINaVz4NXmWlRBTl/zEVX4k1QW4OKKsxuZarPwQM/tJhdAzqviyMqvJ4/1kBD3Q7FfBNo7vOmRf8f82BDMZHZeV3JGWKXqZuMn+zaeausKCg99+RKJcFGSG0/HQnILS1xWhGIK0FCTvZzggz7saRjDNsxoUMbInRCemXlL2rQ63m6UMBfEGWsaSEtQQLHmzb/P+ToEUDmXCYjd7TSDWJ4Hm4em5gDDNjAttAcpWcVjO1LSgYUfO+3+Tji9OXhqEqkYhTSWrVPpyiwekYweAvIh8X6I09eGXYM7FZKqGCz3RcalLVJuDhpkwTCBWrgQlSX27YhoM4CJBgh7keiGFkYa/Ib5xtNR9INSC518jXzl0ttVs7CZ/MFzMSxogOZ9Zk/NkTv/msIphKARjwx4kUL8ojA9RxdFBWWeJzD3UNZcnRu3hLBRY6w== bot@snapshooter.com", "name": "Acme Server SSH Key", "created_at": "2022-01-05T13:54:11.000000Z", "last_used": null }}
Examples
curl -X POST https://api.snapshooter.com/v1/ssh-keys \-H "Content-Type: application/json" \-H "Accept: application/json" \--data-binary @- <<DATA{ "name": "EC2 Server"}DATA
Errors
List Keys #
URL Parameters
string sort (optional)
Parameter to sort by. Must be one of the following: id, name, created_at, updated_at, last_used_at. Default direction is ascending, to request a descending order you can prefix the parameter value with a dash: sort=-last_used_at.
datetime modified_since (optional)
Filter ssh keys that have only been modified after the given date time.
integer page_size (optional)
Amount of results to display per page. Must be betwen 15 and 100.
GET /v1/ssh-keys
curl https://api.snapshooter.com/v1/ssh-keys \ -X GET \ --header 'Authorization: Bearer API_TOKEN_HERE' \
HTTP/2 200{ "data": [ { "id": 5246759, "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQC/P4tuE9JhNtOkdhhybcI/NRIw3aE6xrI4/ncnb3f5p/DR9+uMSXm1nz3QMmGJbRP/fFm0v1lAJOkOXFSRcLg7D9tS6DxsP+DHglXuopyaxiwncjR5KO5D1RhYukLpi25IZ+I+3nM3njSeq5lEN2lotpeGWEqign2IF6CSAGrDfJjlQup4a+3rfRs08jedIinW36R1KwtrfoN721Z47BmnW2Ty2PQKXvgiHQRpmPeSmwVLL+sY8lR61PLWy3+0tZTJbBLCKFQfYCVaeoozAAQDRGa/evR+0nOOKa3+uY2w8XQcCemqQOg3oJ6Oq9ZgLCXGaX2lqjYZmDcAx+Z25Tn0iS0J7JlRqHu4V3qCHcJRsQi4rVqFoGBmDVVtoN8j5Y3Bm0WV1/ZZlzFOe5ug1N4lUq3ixobxCI+kmE8bhDI6M0PFdHpZ853+IsoM2rgIGXB4x0HoqET0kMSvHYx28mHEJo6N1AB5tsHDdqCIiAU7gPVUZj1H5ynAUR/wtkq906M69WME3Yy3RDrpOTaz1bBycJP8uOjIHOgBBej2VYB8eFfKHfX2PNKF2+CwSYz1At0nj2WMUgJT2K1BZxHfxqXi4/MxVlG/hifulOedVJxoLm6MdGvSJB/WGqIOTOfyZ2NLZgaD6GDxIL+bo20+ogyN7KW0PVgJZvi6jPu/h1SfiQ== bot@snapshooter.com", "name": "SnapShooter 2021-08-24 09:19:47", "created_at": "2021-08-24T09:19:47.000000Z", "last_used": "2021-09-12T05:49:14.000000Z" }, { "id": 5246774, "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDaMsdYTs/V/7ssam3hEGjMMbq/dS4cY1TGrS/gLG1uPNbZ3ZWX4YSBpx+oCmUlLUnTiatPtfLLg4c4AQHaSlM2dzj3ZQH1jJTdJTzVryO/I63rBhjGgjFgdzngVGolCVMbu2J1pwABBfPZPJ8vpDwEbHsUKhcgrRFXJXtpgE2bXucrQbt3qf0EQJkm7zbkNNZWDx+ogroCzQ+jkWYiSgxRbQXSWPe9ocedZWKbVP7Md9Z40TCtFZ7elox3AZs7sK4aVR+kSQGBd2b0u0bupk/lHB7j3865hqjFIiyo0xppFJDWk/faUPzq60EskFH3EwoK6EIUfCQg0Amz0HMErZJN3lqWNhq8zLMTcbhFp/vbepNYLrzBH0Nux03BicL/N7FiLRGM28nJ4HJTnUIXgKExeLWm8B8X81s8rtnuytoTp/ePKwfeb+pdELsl2G4f/3uT2nXdMMDRodeySdkYE4WuFwYlfpAI1l+PwE5d2xchcLZgE45Gll/SsPCUF4PIz9DBayaOzN3+MTuNsK+eKPrz0XTROZI1frgI/ErXZd96G5nMsqS6R4gKLVoV+2Kx/oAVioWYlSi5C+aecGi2oCtYFuk9rNWEkEn6dteKQdkyNmqh3H195z98QPLXxHZVmaRdwDtNboD+AAUoGuw7c/8v6/Z3H5JONA/B+WQVgTcqew== bot@snapshooter.com", "name": "SnapShooter 2021-11-11 11:38:24", "created_at": "2021-11-11T11:38:24.000000Z", "last_used": null } ], "links": { }}
Rename Key #
Parameters
string name
New name for the SSH Key
PATCH /v1/ssh-keys/{key_id}/rename
curl https://api.snapshooter.com/v1/ssh-keys/{key_id}/rename \ -X PATCH \ --header 'Authorization: Bearer API_TOKEN_HERE' \
HTTP/2 204//Empty Response Body
Examples
curl -X POST https://api.snapshooter.com/v1/ssh-keys/{key_id}/rename \-H "Content-Type: application/json" \-H "Accept: application/json" \--data-binary @- <<DATA{ "name": "EC2 Main Server"}DATA
Errors
Delete Key #
Parameters
This endpoint does not accept any parametersDELETE /v1/ssh-keys/{key_id}
curl https://api.snapshooter.com/v1/ssh-keys/{key_id} \ -X DELETE \ --header 'Authorization: Bearer API_TOKEN_HERE'
HTTP/2 204//Empty Response Body
Errors
Thank you for helping us improve!