Thanks for reaching out! Yes, Session Manager can be used to run a single interactive command against Windows targets. You can either use Session Manager public document "AWS-StartInteractiveCommand" or create a custom document to run restricted commands. Please refer to the example provided in below documentation and let us know in case of further queries.
Thanks, I didn't know that. But I was actually talking about being able to issue a single command that connects to the remote instance and then executes given command on the instance then disconnects. As opposed to issuing the command to start the session and then issuing the given command after being connected.
I was not referring to restricting the user to a single command.
Thanks for sharing more details! Interactive Command scenario of Session Manager can be used to run a single or a set of predefined commands and it works by establishing a connection which is disconnected once commands are executed.
Below is a sample StartSession request that would execute the command "echo HelloWorld", display the output and disconnect. Here the command to be executed is passed along with the StartSession request.
aws ssm start-session --target <TARGET_ID> --document-name AWS-StartInteractiveCommand --parameters command="echo HelloWorld"
Another alternative would be to create a custom InteractiveCommands type session document with pre defined commands within the document. Below documentation can be referred for the sample custom document scenario:
Please let us know in case of further queries.
That's exactly what I needed. Thank you.
lambda functionasked 2 months ago
EMR : cron: A yarn command is skippedAccepted Answerasked 8 days ago
What is the difference between EC2 Instance Connect and Session Manager SSH connections?Accepted Answerasked 3 years ago
scp command difference for Ubuntu EC2 in a VPCasked 6 months ago
EB-Cli SSH Tunnel to RDS Databaseasked 4 years ago
Can you use session manager to send a single command and return the output?asked 2 years ago
JSON not working as a command in ECSasked a month ago
How to use EventBridge with Systems Manager Run Command to run shell commands?Accepted Answerasked 8 months ago
Can Sagemaker Git Repositories use ssh secrets (no name and password)?Accepted Answerasked 6 months ago
Unable to SSH to the ubuntu managed node using instance-idAccepted Answerasked 3 months ago