aws / ec2-macos-init

EC2 macOS Init is the launch daemon used to initialize Mac instances within EC2.
https://aws.amazon.com/ec2/instance-types/mac/
Apache License 2.0
148 stars 19 forks source link

Is there any way to set the initial ec2-user password #4

Closed YonaLugassi closed 3 years ago

YonaLugassi commented 3 years ago

Hi, I'm using mac os instance on ec2 , I'm trying to build a custom image for my CI/CD pipelines. Is there any way to set a custom password for the ec2-user? I see only the random option, and I don't know what will be the password for VNC connection.

scottmalkie commented 3 years ago

ec2-user doesn't have a password by default, you can set it via sudo passwd ec2-user as shown here: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-mac-instances.html#mac-instance-vnc

mattcataws commented 3 years ago

Hey, hopefully the previous comment answered your question. I'm going to close out this issue since there hasn't been any activity on it for a while. If this doesn't answer your question or you have a followup question, please include some more information about what's going on and reopen this issue.

NRay7882 commented 2 years ago

If you're looking to add this to an init config and need to set the password non-interactively, try sudo dscl . -passwd /Users/ec2-user "$PASSWORD"