Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have managed to set up my server with a default user 'admin'. The sshKeys in the metadata is set with the following format, described in the google documentation.

 key: sshKeys 
 value: admin:ssh-rsa XXXXXXXXXX

However, I am trying to add a new user to the system, hence I updated the metadata to the following

 key: sshKeys 
 value: admin:ssh-rsa XXXXXXXXXX newuser:ssh-rsa YYYYYYYYY

This has worked perfectly for me on one instance of server that I have set up sometime back. However I was unable to set it up on the new one. Can someone help me out with this?

share|improve this question

In the latest Google Compute Engine developer's console, there is an "SSH Keys" configuration section. Generating the equivalent REST (JSON in this case) of the metadata, that shows:

"metadata": { "kind": "compute#metadata", "fingerprint": "some_obfuscated_fingerprint", "items": [{ "key": "sshKeys", "value": "eric:ssh-rsa obfuscated_public_key_here eric@somedomain.com" }]}

So it looks like you have the format for a single key correct (check that you have the username/domain at the end). But when you have multiple keys, I think you have to add a newline character to separate the list entry for each user:

"items": [ { "key": "sshKeys", "value": "user1:ssh-rsa AAAA...pIy9 user@host.domain.com\nuser2:ssh-rsa AAAA...ujOz user@host.domain.com" } ]

from the compute engine open source project

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.