Skip to content

[RFC] Azure Admin User Creation Proposal #273

@peytonr18

Description

@peytonr18

Summary

Currently, Flatcar uses WALinuxAgent to create the Azure admin account specified in Azure VM configuration. The WALinuxAgent component responsible for this has been deprecated in favor of azure-init. To maintain compatibility and user expectations going forward, this functionality can be migrated to either Ignition, Afterburn, and/or Azure-init.

User creation involves:

  • Creating admin user (if specified)
  • Setting SSH keys (if supplied)
  • Setting the password (if supplied)

Additionally, WALinuxAgent configures SSHd’s PasswordAuthentication=[no|yes] based on disable_password_authentication option.

Option 1: Ignition

Ignition-fetch.service fetches user data from IMDS and mounts Azure’s provisioning media. This option will add the capability for ignition to fetch Azure configuration related to the Azure admin account and add/merge it into ignition config.

For example, an empty ignition config in user data would result in something like:

{ 
  "ignition": { 
    "version": "3.4.0" 
  }, 
  "passwd": { 
    "users": [ 
      { 
        "name": "azureuser", 
        "passwordHash": "$6$...", 
        "sshAuthorizedKeys": [ 
          "ssh-ed25519 AAAA...B" 
        ], 
        "groups": [ 
          "sudo", 
          "wheel" 
        ], 
        "homeDir": "/home/azureuser" 
      } 
    ] 
  }, 
  "storage": { 
    "files": [ 
      { 
        "path": "/etc/ssh/sshd_config.d/10-password-auth.conf", 
        "mode": 420, 
        "contents": { 
          "source": "data:,PasswordAuthentication%20yes" 
        } 
      } 
    ] 
  } 
} 

...When the user specifies the following Azure configuration:

'osProfile': {'computerName': 'vm-a083', 'adminUsername': 'azureuser', 'adminPassword': 'mypassword', 'linuxConfiguration': {'disablePasswordAuthentication': False, 'ssh': {'publicKeys': [{'path': '/home/azureuser/.ssh/authorized_keys', 'keyData': 'ssh-ed25519 AAAA...B\n'}]}} 

Option 2: Afterburn

Add the following features, which would only be done on the Microsoft Azure cloud:

  • User creation
  • Password handling (if specified)
  • SSHD config password fragment to allow password-login

Option 3: Azure-init

Create a new systemd service file that runs azure-init with command-line option to limit scope of actions, e.g.:

azure-init --create-user
--configure-user-password
--configure-user-ssh-keys
--configure-sshd-password-authentication

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions