Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AWS remote commands #1

Open
arminc opened this issue May 23, 2017 · 4 comments
Open

AWS remote commands #1

arminc opened this issue May 23, 2017 · 4 comments

Comments

@arminc
Copy link
Owner

arminc commented May 23, 2017

Don't use SSH but use AWS remote commands to execute commands on the instances. This is more secure and beter audited. http://docs.aws.amazon.com/AmazonECS/latest/developerguide/ec2-run-command.html

@denishonig
Copy link

Hi! Could you, please, help me in the following question.
I need to debug why my application does not start on EC2 instance in ECS (I use this repository for deploy infrastructure). What should I do better? For AWS remote commands I also should use SSH. I need to assign elastic ip, allow ssh in security groups, etc?
Thanks

@arminc
Copy link
Owner Author

arminc commented Oct 9, 2017

@denishonig You can create a bastion host and give it access to the EC2 nodes on port 22 that way you can tunnel the SSH connection from your bastion host to your EC2 node.

Your PC -> bastion -> EC2 node for ECS

@dtphuc
Copy link

dtphuc commented Oct 13, 2020

Another way to access EC2 is to use AWS SessionManager https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-getting-started.html.

@cognitiaclaeves
Copy link

Another way to access EC2 is to use AWS SessionManager https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-getting-started.html.

This is the method that I prefer. It requires setting up AWS Systems Manager, which I've found a bit futsy, but which seems to be getting better:

  • Quick start here: https://console.aws.amazon.com/systems-manager/home?region=us-east-1# (be wary of what you choose to set up for system manager -- choosing something like all organizations will probably be overkill, and just consume cycles for no good reason) .... be aware that this step can take some time, In practice, I've often found that it starts working while I'm troubleshooting why it's not working ...
  • Set up instances with a profile that includes the policies in AmazonSSMRoleForInstancesQuickSetup, or use that role, if you don't need anything custom in the role
  • Ensure that outgoing HTTPS access is allowed (usually, outgoing access is not restricted, but some security practices might lead to restricting outgoing access)
  • The SystemManager agent uses outgoing HTTPS to talk to SystemManager. If the instance image doesn't already included it, the agent will need to be installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants