Interactive multi-execution shell

0

Hello All,

I am looking for a way to interactively run shell commands in multiple instances simultaneously.

I know I can run (shell) commands interactively with a single instance through SSM console, and non-interactive scripts, document, with multiple instances through Run Command.

I am using the SSH client tool with 'multi-execution mode' to perform this kind of interactive work. However, I have to open the port to do the work.

If Systems Manager can add 'multi-execution mode' to SSM or interactivity to Run Command, or just a new tool. Then I do not have to poke a hole in my VPC to do the work.

Best regards,

Tiger

2개 답변
0

Hello! SSM has the AWS-StartInteractiveCommand document. For more information you can read the following links:

  1. https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-restrict-command-access.html
  2. https://aws.amazon.com/blogs/mt/limit-ssm-interactive-session-commands-by-users/

Please let me know if the above helps!

AWS
지원 엔지니어
답변함 2년 전
0

Systems Manager allows you to use your SSH client to interactively access instances without requiring network ingress to your EC2 instances.

You will need:

  1. An SSH client that can be configured with ProxyCommand, such as OpenSSH; and
  2. A recent version of the AWS CLI installed.

Once you have that, you can set up your SSH configuration file to access your instances, like so:

# ~/.ssh/config file
# SSH over Session Manager
host i-* mi-*
    ProxyCommand sh -c "aws ssm start-session --target %h --document-name AWS-StartSSHSession --parameters 'portNumber=%p'"

Then, when you run something like ssh i-01234567890, the session will be transported via SSM.

If your multi-session manager uses the standard ssh program under the hood, your experience should be identical to that of using ssh directly.

See Enabling SSH connections for Session Manager for details.

AWS
전문가
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인