docs/modules/howtos/pages/remove_fedora_user_at_launch_aws.adoc
Michal Konecny 1d458e6d8a Migrate howto repository to infra docs
It doesn't make much sense to have separate guides outside infra documentation.
So let's migrate https://pagure.io/fedora-infra/howtos to infra docs.

Signed-off-by: Michal Konecny <mkonecny@redhat.com>
2023-09-18 17:06:59 +02:00

800 B

This will allow you to run ansible playbooks as the root user. It also removes the fedora user so that fas_client can install sucessfully in /home/fedora

Simply add the below text in to the User Data field when launching an EC2 instance. This appears as a text box at the bottom of the Configure Instance step when launching an instance (Step 3).

#!/bin/bash
cat /home/fedora/.ssh/authorized_keys > /root/.ssh/authorized_keys
userdel -r fedora

The script copies the public key from the fedora user and replaces the root users key with it. This is the public key which is associated with the keypair selected when launching the instance. It then deletes the Fedora user leaving root as the only ssh user on the instance.