title: ElasticBeanstalk - Adding ec2-user to another group
body: <p>I have a cron job that needs to be run under <code>ec2-user</code> on my EC2 instance and it needs to be able to write to the standard log files for my web app. However, the log files are owned by <code>webapp</code> (as per normal).</p>
  
  <p>I've successfully changed the permissions on the log files so that they are accessible by both the owner and the group <code>webapp:webapp</code>. But where I'm running into trouble is when I try to add the <code>ec2-user</code> to the <code>webapp</code> group.</p>
  
  <p>I can do it fine in SSH with <code>sudo usermod -a -G webapp ec2-user</code> but when I try to add this command via EB <strong>container-commands</strong>, I get an error saying that <code>you must have a tty to run sudo</code>. Running the command without sudo gives me <code>/bin/sh: usermod: command not found</code>.</p>
  
  <p>Anybody know of any other way to be able to add <code>ec2-user</code> to the <code>webapp</code> group via the Elastic Beanstalk deployment config.</p>