Linux Socket Monitor (LSM) is a lightweight security tool designed to monitor network sockets and Unix domain sockets on a server. It acts as a port monitoring solution that detects newly opened ports and alerts administrators about potential security risks.
LSM works by comparing current server sockets with previously recorded socket information. Whenever a new port becomes active, the system sends an alert notification.
What Is Linux Socket Monitor (LSM)?
LSM continuously monitors:
- Network sockets
- Unix domain sockets
- Newly opened server ports
Unlike traditional monitoring tools, LSM ignores already active services and triggers alerts only when a new socket or port is created.
This makes it useful for detecting:
- Unauthorized services
- Malware activity
- Suspicious port openings
- Unexpected server changes
Step 1: Download LSM
Navigate to the source directory and download the latest LSM package:
cd /usr/local/src
wget http://www.rfxn.com/downloads/lsm-current.tar.gz Step 2: Extract the Package
Extract the downloaded archive:
tar -xvf lsm-current.tar.gz Step 3: Install LSM
Enter the extracted directory and run the installer:
cd lsm-0.6
./install.sh After installation, you should see details similar to:
LSM installed
Install path: /usr/local/lsm
Config path: /usr/local/lsm/conf.lsm
Executable path: /usr/local/sbin/lsm Step 4: Configure Email Alerts
Before receiving notifications, update the configuration file:
vi /usr/local/lsm/conf.lsm Locate the line:
USER="root" Change it to:
USER="user@example.com" This email address will receive alerts whenever new ports are detected.
How LSM Monitoring Works
LSM automatically runs via cron every 10 minutes.
When a new network socket or port is detected, LSM sends an email notification to the configured address.
Useful LSM Commands
Delete Comparison Files
/usr/local/sbin/lsm -d Compare Current Sockets
/usr/local/sbin/lsm -c Generate Base Comparison Files
/usr/local/sbin/lsm -g These commands help manage socket monitoring baselines.
Why Use LSM?
- Lightweight security monitoring
- Detects unauthorized ports instantly
- Automated email alerts
- Easy installation and configuration
- Improves server security visibility
Need Expert Assistance?
SupportPRO offers professional server management services. Our experienced engineers can help with LSM installation, configuration, and server security monitoring.
Need expert assistance?
SupportPRO has a team of well-experienced professionals. We can assist you in the installation and configuration of LSM in your server. Feel free to contact us if you need assistance.
If you require help, contact SupportPRO Server Admin

