0

Right now I am testing to see if I am able to write

touch test.txt

simply to another ec2 instance. I have looked into both ssh and ssm but I do not understand where to begin the code. Any ideas to remotely send commands?

1
  • There are several different ways depending on your security setup. Do the two EC2 instances trust each other? A simple way is shown here but you could also have an HTTP server of some sort or may other ways. What are you ultimately trying to build? Commented Jun 23, 2020 at 20:02

1 Answer 1

1

If you want to send a command remotely you can make use of the AWS run command functionality of SSM.

To do this you will need to ensure that you’re both running SSM agent and have a valid IAM role setup on the remote instance. The getting started section should help that.

Finally you can call the remote instance using the send-command function. Either create your own document or use the existing ‘AWS-RunShellScript’ document.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.