Child pages
  • Add SSH Key
Skip to end of metadata
Go to start of metadata

To add SSH keys to a user profile, use the following call:

POST /users/:user_id/ssh_keys.xml
POST /users/:user_id/ssh_keys.json

XML Request example

curl -X POST -u user:userpass http://onapp.test/users/:user_id/ssh_keys.xml -H 'Accept: application/xml' -H 'Content-type: application/xml' -d'<ssh_key><key> ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAqzsLk+oPP9Qxz0Xgpqoe9DqNV7Qe3+oig/o6Ubt30Yh+Zarf8NXctqqeamC1KrlMt12d0AWd38dZ0CU6Eru/2ciwzz2IB0MLrTyjfLCNe2CW64uNjhSS1SH6gSjJUYwHSi7jUBl0vlGtJ7jswBdhgaKkjk1vXH3YFLTHPuKU+pc= user@onapp.test</key></ssh_key>' 

JSON Request example

curl -X POST -u user:userpass http://onapp.test/users/:user_id/ssh_keys.json -H 'Accept: application/json' -H 'Content-type: application/json' -d'{"ssh_key":{"key":"ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAqzsLk+oPP9Qxz0Xgpqoe9DqNV7Qe3+oig/o6Ubt30Yh+Zarf8NXctqqeamC1KrlMt12d0AWd38dZ0CU6Eru/2ciwzz2IB0MLrTyjfLCNe2CW64uNjhSS1SH6gSjJUYwHSi7jUBl0vlGtJ7jswBdhgaKkjk1vXH3YFLTHPuKU+pc= user@onapp.test"}}'

Where:

key* - a SSH key in the following format: ssh-[type] [ascii-symbols allowed for base64 string] [user credentials]

  • No labels