1

Upon creating a new Ubuntu instance on GCP (from the official 18 LTS image), I noticed that it already has a few users in the /home folder. These are user names that I've created in the past on another instance. The new instance is created from scratch, not cloned. I'm wondering why this would happen?

3
  • 1
    Do the names look like the user ID that you log into the Google Cloud Console? Aug 30, 2019 at 13:02
  • Some of them are locally created accounts on another box.
    – Jack C
    Aug 30, 2019 at 16:39
  • You need to be more specific. Aug 30, 2019 at 17:22

1 Answer 1

2

As outlined in this documentation, the google-accounts daemon in compute-image-packages creates users and home directories for all users in the project that have SSH access after booting the new instances (these accounts are registered as SSH keys in the Compute Engine metadata).

The google-accounts daemon repeatedly polls the metadata server and creates home directories, UNIX accounts, and entries in ~/.ssh/authorized_keys to allow you to login.

You should either:

Option 1. Remove those users and home directories from the instance with SSH access and disable google-accounts-daemon service.

To do this, set accounts_daemon to false in the /etc/default/instance_configs.cfg file:

[Daemons] accounts_daemon = false

Regenerate /etc/default/instance_configs.cfg configuration file:

$ sudo /usr/bin/google_instance_setup

Stop google-accounts-daemon service:

$ sudo systemctl stop google-accounts-daemon

and disable google-accounts-daemon service:

$ sudo systemctl disable google-accounts-daemon

It will prevent the GCE instance from adding accounts and the google-accounts-daemon won't start at boot.

Option 2. Switch to OS Login based SSH access to manage SSH access to Linux instances.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .