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

Display motd on session start

Open awiddersheim opened this issue 7 years ago • 16 comments

This might be loosely related to #131, at least in my mind, but it'd be nice when starting a new session the systems motd gets displayed. This is usually handled by pam, at least that is the case on my Ubuntu system.

Also, something similar to SSH's Banner may be nice as well.

awiddersheim avatar Apr 03 '19 17:04 awiddersheim

+1

kjpopov avatar May 31 '19 11:05 kjpopov

Thank you for the feedback, we'll investigate this.

YujiaozhAws avatar Jul 11 '19 18:07 YujiaozhAws

+1

kchaitu4 avatar Apr 11 '20 14:04 kchaitu4

+1

jusrob avatar May 12 '20 18:05 jusrob

@YujiaozhAws do you have this on the roadmap possibly? It is hard to achieve some NIST control requirements without the ability to display a message to users on login.

shannonrdunn avatar Jun 11 '20 20:06 shannonrdunn

@shannonrdunn if you do ssh over ssm the banner is displayed if that helps

jimilinuxguy avatar Jun 11 '20 20:06 jimilinuxguy

@jimilinuxguy thanks! but we are trying not to allow ssh at all, and force ssm use. ssh over ssm you still have to use/manage the key pair right, and have port 22 exposed to the user?

shannonrdunn avatar Jun 11 '20 20:06 shannonrdunn

This might help some of you: https://github.com/elpy1/ssh-over-ssm

I can't vouch for that project, though it uses standard SSH, but does it OVER SSM, so far as I can tell does not require port 22 exposed, and it manages dynamic keypairs for short term use that the user themselves doesn't have to have, create, or even see.

Note I still thumb'd up the overall topic here which is getting a banner/MOTD through standard SSM Connect as ideal for my use cases, though was looking into other options.

adamdmharvey avatar Jun 11 '20 20:06 adamdmharvey

@shannonrdunn Unfortunately key management is still required. The agency I work with implemented ssh over ssm and closed port 22 and used a script similar to https://www.keepsecure.ca/blog/automating-access-through-a-jump-host-aws/ to automatically add the keys to the instance and expire them shortly to help fight the issue you are having.

jimilinuxguy avatar Jun 11 '20 20:06 jimilinuxguy

@adamdmharvey @jimilinuxguy wow these are great, and work great. thanks so much.

shannonrdunn avatar Jun 16 '20 14:06 shannonrdunn

This would be fantastic to have especially for highly regulated industries.

j-rat avatar Nov 11 '20 05:11 j-rat

I forgot about this a bit. You can sort of achieve this now with the introduction of shell profiles.

https://aws.amazon.com/about-aws/whats-new/2020/10/now-customize-your-session-manager-shell-environment-with-configurable-shell-profiles/

awiddersheim avatar Nov 11 '20 13:11 awiddersheim

This can be accomplished by using shell profiles. Closing.

ferkhat-aws avatar Feb 19 '21 15:02 ferkhat-aws

Could someone provide an example of how we can use shell profiles to display the existing motd?

A workaround is to use shell profiles to echo the motd. It's a bit of a hack and ends up printing the command and then the output when a user ssms into an instance resulting in seeing the motd twice.

nitrocode avatar Mar 15 '24 00:03 nitrocode

This can be accomplished by using shell profiles. Closing.

I agree, however, the really annoying part is that with shell profiles, the output is duplicated. Would be really great to not have this duplicated and omit the commands that were run.

What's the best way, if any to prevent the command from being displayed?

echo -e "===\n===\n=== This is my warning banner.  There are many like it, but this one is mine.\n=== My warning banner is my best friend. It is my life. I must master it as I must master my life.\n=== My warning banner, without me, is useless. Without my warning banner, I am useless.\n===\n===\n"
t me, is useless. Without my warning banner, I am useless.\n===\n===\n"r, withou
===
===
=== This is my warning banner.  There are many like it, but this one is mine.
=== My warning banner is my best friend. It is my life. I must master it as I must master my life.
=== My warning banner, without me, is useless. Without my warning banner, I am useless.
===
===

sh-4.2$

j-rat avatar May 07 '24 22:05 j-rat

+1 for out-of-the box /etc/motd support

esantoro avatar Apr 01 '26 12:04 esantoro