I’m working on a project where I’ve created a custom environment that includes custom applications using the NVIDIA driver, CUDA, etc. Users need to sign in to this environment using RDP (xrdp) on an EC2 instance. I have this working on an instance based on the "Deep Learning Base OSS Nvidia Driver GPU AMI (Ubuntu 22.04)". My goal is to create a custom AMI from this instance so that users can easily start a new instance, log in via RDP, and use the environment.
In the base AMI, the "ubuntu" user doesn’t have a password set. Currently, I can set the password manually by connecting to the instance via SSH and using sudo passwd ubuntu
, but I’d like to avoid this step for end users who might not have SSH clients available. After creating the custom AMI and launching a new instance from it, the "ubuntu" user password I set on the original instance doesn’t carry over to the new instances.
How can I set a default password for the "ubuntu" user in my custom AMI so that it persists across new instances? Any help or suggestions would be greatly appreciated. Thanks!
2
Answers
For anyone facing the same problem, following is the solution that worked for me: taken from here
If your use case is just to let users to connect to the EC2 instance you can ditribute a key pair that users will use when they create the EC2.
But if your needs is a password authentication for some reasons you can use AWS Image builder to:
script to add