Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

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

1 Answer 1

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" }]}

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\nuser2:ssh-rsa AAAA...ujOz" } ]

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.