I have a cron job that should run under ec2-useron my EC2 instance and it should be able to write to standard log files for my web application. However, the log files belong webapp(as usual).
I have successfully changed the permissions on the log files so that they are available to both the owner and the group webapp:webapp. But when I run into difficulties, I try to add a group ec2-userto a group webapp.
I can do this in SSH using sudo usermod -a -G webapp ec2-user, but when I try to add this command via EB container-commands , I get an error you must have a tty to run sudo. Running a command without sudo gives me /bin/sh: usermod: command not found.
Does anyone know of any other way to add ec2-userto a group webappthrough the Elastic Beanstalk deployment configuration.
source
share