amazon-ssm-agent icon indicating copy to clipboard operation
amazon-ssm-agent copied to clipboard

`aws ssm start-session` for on-premise installations

Open kellertobias opened this issue 7 years ago • 16 comments

We are using the Systems Manager for Managing our Servers as well as the EC2 ones as also the few we have in our Office.

It would be great to be able to also use the session manager to connect to these servers.

kellertobias avatar Jan 25 '19 15:01 kellertobias

Thank you using Session Manager and sharing the feedback! We will look into supporting Session Manager for on-premise instances.

munindradas avatar Jan 28 '19 19:01 munindradas

+1

martenjacobs avatar Feb 11 '19 11:02 martenjacobs

@kellertobias it is now available through Session Manager. Follow the Getting started

caladfelipe avatar Feb 13 '19 02:02 caladfelipe

@caladfelipe Documentation clearly states that Session Manager does not support on-prem instances:

Note

Session Manager supports Amazon EC2 instances only. On-premises instances are not supported at this time.

aws ssm start-session --target <on-prem-instance-id> returns a BadRequest.

kouak avatar Feb 13 '19 21:02 kouak

Definitely a much needed feature. Anxiously waiting when its rolled out. Seeing AWS working on it according to this blog post: https://aws.amazon.com/blogs/aws/new-session-manager/

msegzda avatar Feb 22 '19 08:02 msegzda

Session Manager is now supported for on premise instances. Check out the release notes here - AWS - What's new.

prasak-amzn avatar Mar 08 '19 22:03 prasak-amzn

@prasak-amzn Might want to update the public docs. As @kouak said, https://docs.aws.amazon.com/systems-manager/latest/userguide/what-is-session-manager.html still states the following:

"Session Manager lets you establish secure connections to your Amazon Elastic Compute Cloud (Amazon EC2) instances. On-premises instances are not supported at this time"

Glad to see the feature is out, thanks!

BenPerel avatar Mar 22 '19 19:03 BenPerel

@BenPerel The public doc link you mentioned (https://docs.aws.amazon.com/systems-manager/latest/userguide/what-is-session-manager.html) is now accurate. Thanks for the callout.

omieomye avatar Apr 08 '19 22:04 omieomye

Closing issue as on-prem session manager is now supported.

hiimtu avatar May 29 '19 22:05 hiimtu

Pitty this is enabled with advanced on-premise service which requires extra monthly fee

msegzda avatar Jun 04 '19 12:06 msegzda

I am still seeing this problem. Set up a raspberry pi with current raspbian (debian release 10.1), installed ssm agent (2.3.714.0-1), create hybrid activation, finished activation procedure successfully, managed instance shows as "online".

Using "start session" action from console generates a red "An unknown error occurred" banner.

Using the cli generates "BadRequest" with no additional information

# aws ssm start-session --target mi-0e94eaae27bc99c65

An error occurred (BadRequest) when calling the StartSession operation: 

rudpot avatar Oct 09 '19 01:10 rudpot

I am still seeing this problem. Set up a raspberry pi with current raspbian (debian release 10.1), installed ssm agent (2.3.714.0-1), create hybrid activation, finished activation procedure successfully, managed instance shows as "online".

Using "start session" action from console generates a red "An unknown error occurred" banner.

Using the cli generates "BadRequest" with no additional information

# aws ssm start-session --target mi-0e94eaae27bc99c65

An error occurred (BadRequest) when calling the StartSession operation: 

Nevermind - it actually works if one performs the "optional" step to enable "advanced" features and pricing.

rudpot avatar Oct 09 '19 01:10 rudpot

Piggy back on this one. What exactly does it mean to "you must install and enable a certificate from Amazon Trust Services using AWS Certificate Manager (ACM). " for a on promise VM? I assume it means a certificate is required if the vm is to communicate with AWS services. Some examples will be helpful.

ju187 avatar Jan 10 '20 01:01 ju187

I encounter such problem but when I troubleshoot it, it's caused by wrong default region(mine was pointing ap-northeast-1 but mi- was located in ap-southeast-1).

lucheeseng827 avatar Jan 31 '20 08:01 lucheeseng827

Piggy back on this one. What exactly does it mean to "you must install and enable a certificate from Amazon Trust Services using AWS Certificate Manager (ACM). " for a on promise VM? I assume it means a certificate is required if the vm is to communicate with AWS services. Some examples will be helpful.

For the SSM agent to validate that it's actually talking to a legitimate amazon endpoint it needs to have an Amazon Root Certificate installed in the system root certificates. As per this stackexchange article, on a raspberry pi you can verify that they are installed like so:

awk -v cmd='openssl x509 -noout -subject' '
    /BEGIN/{close(cmd)};{print | cmd}' < /etc/ssl/certs/ca-certificates.crt \
| grep -i amazon

These are likely already installed by default but if not, just check how to install root certs on your system and grab the relevant root certs from amazontrust.com as described here

rudpot avatar Feb 03 '20 19:02 rudpot

@rudpot,

Any clue what the issue may be if certificates actually are installed on the target instance?

awk -v cmd='openssl x509 -noout -subject' '
    /BEGIN/{close(cmd)};{print | cmd}' < /etc/ssl/certs/ca-certificates.crt \
| grep -i amazon
subject=C = US, O = Amazon, CN = Amazon Root CA 1
subject=C = US, O = Amazon, CN = Amazon Root CA 2
subject=C = US, O = Amazon, CN = Amazon Root CA 3
subject=C = US, O = Amazon, CN = Amazon Root CA 4

altjx avatar Nov 16 '20 22:11 altjx