Skip to content
Advertisement

How to create an executable file with SSM and basic commands on ubuntu

Hello everyone I would like to ask for your assistance regarding scenario below. using my local ubuntu machine I want to access and create an executable to my AWS Instance machine. I tried to use same commands with my executable file however it doesn’t work, but works if I just paste the command on my CLI, it doesn’t push thru and stops after “aws ssm start-session” command. Your response is highly appreciated. Thank you so much.

This is the command I used to access and install my AWS Machine:

export AWS_ACCESS_KEY_ID=”ASIASHIYHNRJMIE52OP2″ export AWS_SECRET_ACCESS_KEY=”Zlmki7fOg3XLWYQYRp55mylgiuffCJbsMh0c2upu” export AWS_SESSION_TOKEN=”IQoJb3JpZ2luX2VjEOH//////////wEaCXVzLWVhc3QtMSJHMEUCIQCsuuLiCr/hAzMMDBeI7veb5mRRaTDph8MpmXUacs6pFPbSgIgMCwgSxdwzPZTSJkmEnm4Oaavozz3xrBqVLwiRzQRh6QqqgMImf//////////ARAAGgwxNTMwNTkwMjgwNTAiDM7dlNKEORNon4QnTSr+AleIWt0EBxM5lWHraEDvaGdlG4ocAE4cADKDfX6blILhUC5FWaWfMaYaAvKgT23hJ8wUPyHjlortb8oOeEwl0bW4XD6S6kis9Gi1g5D6DDJlrjgKfoLrLkHL5XJ7QabkbmNf6xs5mUuwW6nI6vSR6aXlih3zjgLp30Aivo+ubrj2lo4Lm+nQPfR5mop7JTHQpTzbh/zqgLpFgdso+86jI1KcRRHJxEKfbArPzv38yfFkZtGyFGfX+hETnZ1c9GQCilKzhq7Bz60oopC0JrsKZ6U9cMfTGwF7kNd31G9/T7mupsq540VYT6fj43w0VKCcf8bJbBGbYed5OsKf5vfLV+nCOf2sFwlaa8mwnqcS95uiG59gF9y9Mma4bT6wLwqjBrjB3Xo1lYu/IuQiFPfT9XAZ0L42z/AEcBIa6EEtOjGkeSLtT8u6hoYMqPrg1pzM52Ckd/6OlAvkJuISBLAreweSysgPyhVGG7TKTvQL4ULGxUt8BNJIIWO88NN/OfcwzdTomQY6pgEvA14o3xY4nAzpRqWeanbaiiQmw/lXTvZIatggoEM7oe1TX/sD2iB2gir+5HQxO4ZMC5c0xy8XlkcWYidEjuLrlLZ6Bz9m3jWf0uNavwts20IRUf71maLlAFJ8ozWKqtt71c+62/K8cL/f3u/FXE9NdXnr7q+oCxtWUiemw0EOtmUWGwCLOKBrNVJk+zyFVxtA/3stl4dSCj1Ve9L+t5upZvfoBbIH” aws ssm start-session –target i-0fac71837dd267123 sudo -i sudo apt-get update sudo apt install curl -y sudo apt install -y default-jdk

Screenshot:

File Content

Advertisement

Answer

Duplicate of How to run command on EC2 instance after starting session manager on it using bash script?

Also, delete your API keys and invalidate any still active session tokens you have that have hit sites like this one. Do it now. 😀

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement