Live data from Hacker News

Send a message to teams channel on Linux server SSH connexion

github.com

1–10 of 21 posts

Re: Send a message to teams channel on Linux server SSH connexion

#2
I've copied a project that basically sends a message to telegram with informations when someone connects on a linux server.

But this time it's for MS Teams channels, which is possible through Webhooks.

I thought that might be interesting for other persons so I share :) It can probably be adapted to any other webhooks, as soon as webhook urls accepts the JSON sent.

Re: Send a message to teams channel on Linux server SSH connexion

#7
post #6

This is done via profile.d and can be circumvented by executing anything else than a login shell: ssh host /bin/sh -i Better would be enabling PAM via sshd_config and generating the message from there.

See eg this for inspiration:

https://askubuntu.com/questions/179889/how-do-i-set-up-an-em...

Re: Send a message to teams channel on Linux server SSH connexion

#9
post #6

This is done via profile.d and can be circumvented by executing anything else than a login shell: ssh host /bin/sh -i Better would be enabling PAM via sshd_config and generating the message from there.

Or to actually get a login shell, but without loading the profile:

> ssh host -t "bash --noprofile"

Post reply on HN