Monitor User activity with mTracker

Harry - The DevOps Guy
2 min readMar 13, 2021

If you have any sensitive or critical server and you want to monitor user activity and get notification on your slack channel.

Here I want to share one of script which is created by me. script name is mTracker. you can run following command to install mTracker.

What is mTracker?

mTracker is small script to track user Activities on linux system. We can monitor all user what commands they are executing on linux system.

How To Install/Setup mTrack Script on ubuntu.

We can install this script script on any of debian system.

Step 1: Install Script - Readme.md.

sudo curl -sL "https://github.com/harrythedevopsguy/mSend/raw/master/tools/mTrack.sh" -o /etc/profile.d/mTracker.sh

Step 2: Update SLACK_CLI_TOKEN and SLACK_CHANNEL To get notification on Slack Channel Group.

Edit /etc/profile.d/mTracker.sh file and update SLACK_CLI_TOKEN and SLACK_CHANNEL variable.

#sudo vim /etc/profile.d/mTracker.sh#update below variables
export SLACK_CLI_TOKEN='xoxb-xxxxxxxxxxx-xxxxxxxxx-xxxxxxxxxxxxxxxxx'
export SLACK_CHANNEL="#devops"

Create Slack Bot for your Applications : https://slack.com/intl/en-in/help/articles/115005265703-Create-a-bot-for-your-workspace

if you have configured above steps perfectly on your linux server. than try to access your server with ssh and test.

You will get slack notification when someone will access your server. and it will notify you on slack with all the commands which is executed by the user.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Harry - The DevOps Guy
Harry - The DevOps Guy

Written by Harry - The DevOps Guy

I like to solve DevOps and Coding challenge.

No responses yet

Write a response