I passed some scripts to EC2 userdata to install at starup. One of those is
sudo tasksel install lamp-server
When this process runs, it prompts for mysql password,twice, to bypass this, I use
sudo debconf-set-selections <<< "mysql-server mysql-server/root_password password pass" sudo debconf-set-selections <<< "mysql-server mysql-server/root_password_again password pass" sudo tasksel install lamp-server
The script runs fine when I ssh into the instance and manually run it. However when I put this into user-data of an EC2, this error happened
can't open /dev/tty: No such device or address
So is there any work-around?