Skip to content

Get notified when someone logs into SSH on a server, easily through a Discord Webhook.

License

Notifications You must be signed in to change notification settings

guldkage/SSHLogger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SSHLogger

Get notified when someone logs into SSH on a server, easily through a Discord Webhook. This works with both password and ssh key logins.

By default, it pings everyone when someone has logged in. However, this can be changed in the config.

Features

  • Awareness. You know when someone has logged in, so you can react quickly if it wasn't you.
  • You can change the discord webhook message easily.

Requirements

  • A server running NodeJS, NPM and Git
  • A discord server, account and webhook.
  • For this guide, you need a Debian based system. This will work on other distros too, though.

Installation

# Install required packages
sudo apt install npm git

sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_16.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list

apt update
apt install nodejs

# Clone files
git clone https://github.com/guldkage/SSHLogger/
cd SSHLogger

# Install requirements
npm i

# Edit the config (any editor)
nano config.yaml

# Start SSHLogger
node index.js

Run in background

To run SSHLogger in background, it can be created in a systemd service to run in the background and start automatically at machine startup.

cp sshlogger.service /etc/systemd/system/sshlogger.service

# You might need to change WorkingDirectory, unless SSHLogger is in root directory.
nano /etc/systemd/system/sshlogger.service

systemctl daemon-reload
systemctl enable sshlogger --now

About

Get notified when someone logs into SSH on a server, easily through a Discord Webhook.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published