Closed
Description
/kind bug
What steps did you take and what happened:
Once our Amazon Linux 2 AMI is used, the default user to be used with Amazon Linux is centos
. The default user supported by AWS is ec2-user
and is present in the system we provide. It's that cloud-init
is comnfigured to use centos
user:
# cat /etc/cloud/cloud.cfg
[...]
# System and/or distro specific settings
# (not accessible to handlers/transforms)
system_info:
# This will affect which distro class gets used
distro: centos
# Default user name + that default users groups (if added/used)
default_user:
name: centos # <--- here's where the problem is
lock_passwd: True
gecos: centos Cloud User # <--- this should be changed too
groups: [wheel, adm, systemd-journal]
sudo: ["ALL=(ALL) NOPASSWD:ALL"]
shell: /bin/bash
# Other config here will be given to the distro class and/or path classes
paths:
cloud_dir: /var/lib/cloud/
templates_dir: /etc/cloud/templates/
ssh_svcname: sshd
What did you expect to happen:
When instance uses Amazon Linux, ec2-user
system user should be used to loggin the instance.
Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]
Environment:
- Cluster-api-provider-aws version:
- Kubernetes version: (use
kubectl version
): - OS (e.g. from
/etc/os-release
):