mercredi 1 juillet 2015

login using "ec2-user" instead of root using user data in aws

I have an Amazon EC2 instance based off of a RHEL 6.4 64bit AMI. After writing some shell scripts; I created my own AMI Image off of it.

I'm writing user data section which will remove the contents under /home/ec2-user(sudo rm -rf /home/ec2-user/*) and then execute that script. But i'm unable to remove any files.

what I want:

  • I want to remove files.
  • One more weird use case I've, by default user data section enters as "root" user but is there possibility to enter as "ec2-user" user and get my work done..?



Aucun commentaire:

Enregistrer un commentaire