Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

roachprod: add public keys for all users to authorized_keys on AWS #35759

Merged
merged 1 commit into from
Mar 15, 2019

Conversation

ajwerner
Copy link
Contributor

Currently only the creating user has their key installed on AWS vms which is
unfortunate for debugging. On GCE we configure our VMs to have user accounts
for all users in the current project. On AWS we just have a single user named
ubuntu. Mostly because it was the simplest approach, this PR detects whether
we're creating an AWS cluster and if so, retreives the list of public keys from
gcloud and installs them into the authorized_keys file for the ubuntu user.

Release note: None

@ajwerner ajwerner requested a review from dt March 14, 2019 20:52
@cockroach-teamcity
Copy link
Member

This change is Reviewable

if colonIdx == -1 {
return nil, fmt.Errorf("malformed public key line %q", string(line))
}
// Skip users named "root" or "ubuntu" which don't correspond to humands
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

humands

@ajwerner ajwerner force-pushed the ajwerner/ssh-keys-on-aws branch from 50edd63 to 67f2278 Compare March 14, 2019 21:00
Currently only the creating user has their key installed on AWS vms which is
unfortunate for debugging. On GCE we configure our VMs to have user accounts
for all users in the current project. On AWS we just have a single user named
`ubuntu`. Mostly because it was the simplest approach, this PR detects whether
we're creating an AWS cluster and if so, retreives the list of public keys from
gcloud and installs them into the authorized_keys file for the ubuntu user.

Release note: None
@ajwerner ajwerner force-pushed the ajwerner/ssh-keys-on-aws branch from 67f2278 to a49ae6f Compare March 14, 2019 22:44
@ajwerner
Copy link
Contributor Author

bors r+

craig bot pushed a commit that referenced this pull request Mar 15, 2019
35759: roachprod: add public keys for all users to authorized_keys on AWS r=ajwerner a=ajwerner

Currently only the creating user has their key installed on AWS vms which is
unfortunate for debugging. On GCE we configure our VMs to have user accounts
for all users in the current project. On AWS we just have a single user named
`ubuntu`. Mostly because it was the simplest approach, this PR detects whether
we're creating an AWS cluster and if so, retreives the list of public keys from
gcloud and installs them into the authorized_keys file for the ubuntu user.

Release note: None

Co-authored-by: Andrew Werner <[email protected]>
@craig
Copy link
Contributor

craig bot commented Mar 15, 2019

Build succeeded

@craig craig bot merged commit a49ae6f into cockroachdb:master Mar 15, 2019
ajwerner added a commit to ajwerner/cockroach that referenced this pull request May 10, 2019
Previously in cockroachdb#35759 logic was added to read public keys from the gce project
metadata and distribute them into the authorized_keys file of the shared user
(ubuntu) on AWS. cockroachdb#37077 primarily served to distribute known_hosts files to
the shared user (ubuntu) on both AWS and GCE as well as the creating user on GCE.
That change also included logic to write the authorized_keys file to the shared
user on GCE (as opposed to just AWS) in anticipation of switching roachprod to
use the shared user across cloud providers. This change extends the previous
change by also distributing all public keys to the authorized_keys file for the
cluster creating user on GCE.

Release note: None
ajwerner added a commit that referenced this pull request Jun 4, 2019
Previously in #35759 logic was added to read public keys from the gce project
metadata and distribute them into the authorized_keys file of the shared user
(ubuntu) on AWS. #37077 primarily served to distribute known_hosts files to
the shared user (ubuntu) on both AWS and GCE as well as the creating user on GCE.
That change also included logic to write the authorized_keys file to the shared
user on GCE (as opposed to just AWS) in anticipation of switching roachprod to
use the shared user across cloud providers. This change extends the previous
change by also distributing all public keys to the authorized_keys file for the
cluster creating user on GCE.

Release note: None
craig bot pushed a commit that referenced this pull request Jun 4, 2019
37438: roachprod: distribute authorized_keys to creating user on gce r=ajwerner a=ajwerner

Previously in #35759 logic was added to read public keys from the gce project
metadata and distribute them into the authorized_keys file of the shared user
(ubuntu) on AWS. #37077 primarily served to distribute known_hosts files to
the shared user (ubuntu) on both AWS and GCE as well as the creating user on GCE.
That change also included logic to write the authorized_keys file to the shared
user on GCE (as opposed to just AWS) in anticipation of switching roachprod to
use the shared user across cloud providers. This change extends the previous
change by also distributing all public keys to the authorized_keys file for the
cluster creating user on GCE.

Release note: None

Co-authored-by: Andrew Werner <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants