'How to turn off sshd in ElasticBeanstalk ec2?

I need to turn off sshd service in ElasticBeanstalk ec2. (Docker MultiContainer) e.g) service sshd stop.

So i try to add .ebextensions commands.(refer to link https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html)

0_command.config

container_commands:
  00-stop-sshd:
    command: 'sudo service sshd stop'

but it is not worked. I wonder why it doesn't work. How can I execute the above command?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source