{"id":1422,"date":"2015-01-22T21:03:45","date_gmt":"2015-01-23T03:03:45","guid":{"rendered":"http:\/\/blog.supportpro.com\/?p=1422"},"modified":"2026-03-26T23:22:31","modified_gmt":"2026-03-27T05:22:31","slug":"linux-socket-monitor","status":"publish","type":"post","link":"https:\/\/www.supportpro.com\/blog\/linux-socket-monitor\/","title":{"rendered":"Install and Configure Linux Socket Monitor (LSM) | Guide"},"content":{"rendered":"\n<p>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.<\/p>\n\n\n\n<p>LSM works by comparing current server sockets with previously recorded socket information. Whenever a new port becomes active, the system sends an alert notification.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What Is Linux Socket Monitor (LSM)?<\/h2>\n\n\n\n<p>LSM continuously monitors:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Network sockets<\/li>\n\n\n\n<li>Unix domain sockets<\/li>\n\n\n\n<li>Newly opened server ports<\/li>\n<\/ul>\n\n\n\n<p>Unlike traditional monitoring tools, LSM ignores already active services and triggers alerts only when a <strong>new socket or port<\/strong> is created.<\/p>\n\n\n\n<p>This makes it useful for detecting:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Unauthorized services<\/li>\n\n\n\n<li>Malware activity<\/li>\n\n\n\n<li>Suspicious port openings<\/li>\n\n\n\n<li>Unexpected server changes<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1: Download LSM<\/h2>\n\n\n\n<p>Navigate to the source directory and download the latest LSM package:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/usr\/local\/src<br>wget http:\/\/www.rfxn.com\/downloads\/lsm-current.tar.gz<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2: Extract the Package<\/h2>\n\n\n\n<p>Extract the downloaded archive:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tar -xvf lsm-current.tar.gz<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3: Install LSM<\/h2>\n\n\n\n<p>Enter the extracted directory and run the installer:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd lsm-0.6<br>.\/install.sh<\/code><\/pre>\n\n\n\n<p>After installation, you should see details similar to:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>LSM installed<br>Install path: \/usr\/local\/lsm<br>Config path: \/usr\/local\/lsm\/conf.lsm<br>Executable path: \/usr\/local\/sbin\/lsm<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 4: Configure Email Alerts<\/h2>\n\n\n\n<p>Before receiving notifications, update the configuration file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vi \/usr\/local\/lsm\/conf.lsm<\/code><\/pre>\n\n\n\n<p>Locate the line:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>USER=\"root\"<\/code><\/pre>\n\n\n\n<p>Change it to:<\/p>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<pre class=\"wp-block-code\"><code>USER=\"user@example.com\"<\/code><\/pre>\n<\/div><\/div>\n\n\n\n<p>This email address will receive alerts whenever new ports are detected.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How LSM Monitoring Works<\/h2>\n\n\n\n<p>LSM automatically runs via <strong>cron<\/strong> every 10 minutes.<\/p>\n\n\n\n<p>When a new network socket or port is detected, LSM sends an email notification to the configured address.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Useful LSM Commands<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Delete Comparison Files<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/usr\/local\/sbin\/lsm -d<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Compare Current Sockets<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/usr\/local\/sbin\/lsm -c<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Generate Base Comparison Files<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>\/usr\/local\/sbin\/lsm -g<\/code><\/pre>\n\n\n\n<p>These commands help manage socket monitoring baselines.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why Use LSM?<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Lightweight security monitoring<\/li>\n\n\n\n<li>Detects unauthorized ports instantly<\/li>\n\n\n\n<li>Automated email alerts<\/li>\n\n\n\n<li>Easy installation and configuration<\/li>\n\n\n\n<li>Improves server security visibility<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Need Expert Assistance?<\/h2>\n\n\n\n<p>SupportPRO offers professional server management services. Our experienced engineers can help with LSM installation, configuration, and server security monitoring.<\/p>\n\n\n\n<p>Need expert assistance?<\/p>\n\n\n\n<p><a href=\"https:\/\/www.supportpro.com\/\"><strong>SupportPRO<\/strong><\/a> 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.<\/p>\n\n\n\n<p>If you require help, <a href=\"https:\/\/www.supportpro.com\/requestquote.php\">contact SupportPRO Server Admin<\/a><\/p>\n\n\n\n<p class=\"has-text-align-center\"><span id=\"hs-cta-wrapper-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-wrapper\"><span id=\"hs-cta-9d590242-d641-4383-94b4-8cfd62f0af6b\" class=\"hs-cta-node hs-cta-9d590242-d641-4383-94b4-8cfd62f0af6b\"><a href=\"https:\/\/www.supportpro.com\/freecheckup.php\"><\/a><\/span><\/span><\/p>\n\n\n\n<div class=\"wp-block-media-text alignwide has-media-on-the-right is-stacked-on-mobile is-vertically-aligned-center has-white-background-color has-background\"><div class=\"wp-block-media-text__content\">\n<p class=\"has-large-font-size\">Facing issues? <\/p>\n\n\n\n<p class=\"has-large-font-size\">Our technical support<br>engineers can solve it. <\/p>\n\n\n\n<!--HubSpot Call-to-Action Code --><span class=\"hs-cta-wrapper\" id=\"hs-cta-wrapper-3350a795-db50-482f-9911-301930d1b1be\"><span class=\"hs-cta-node hs-cta-3350a795-db50-482f-9911-301930d1b1be\" id=\"hs-cta-3350a795-db50-482f-9911-301930d1b1be\"><!--[if lte IE 8]><div id=\"hs-cta-ie-element\"><\/div><![endif]--><a href=\"https:\/\/cta-redirect.hubspot.com\/cta\/redirect\/2725694\/3350a795-db50-482f-9911-301930d1b1be\" ><img decoding=\"async\" class=\"hs-cta-img\" id=\"hs-cta-img-3350a795-db50-482f-9911-301930d1b1be\" style=\"border-width:0px;\" src=\"https:\/\/no-cache.hubspot.com\/cta\/default\/2725694\/3350a795-db50-482f-9911-301930d1b1be.png\"  alt=\"Contact Us today!\"\/><\/a><\/span><script charset=\"utf-8\" src=\"https:\/\/js.hscta.net\/cta\/current.js\"><\/script><script type=\"text\/javascript\"> hbspt.cta.load(2725694, '3350a795-db50-482f-9911-301930d1b1be', {\"useNewLoader\":\"true\",\"region\":\"na1\"}); <\/script><\/span><!-- end HubSpot Call-to-Action Code -->\n<\/div><figure class=\"wp-block-media-text__media\"><img fetchpriority=\"high\" decoding=\"async\" width=\"904\" height=\"931\" src=\"https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup.png\" alt=\"guy server checkup\" class=\"wp-image-12943 size-full\" srcset=\"https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup.png 904w, https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup-291x300.png 291w, https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup-768x791.png 768w, https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup-585x602.png 585w\" sizes=\"(max-width: 904px) 100vw, 904px\" \/><\/figure><\/div>\n","protected":false},"excerpt":{"rendered":"<p>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&hellip;<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[5,6,3],"tags":[],"class_list":["post-1422","post","type-post","status-publish","format-standard","hentry","category-general-topics","category-linux-basics","category-technical-articles"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/1422","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/comments?post=1422"}],"version-history":[{"count":7,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/1422\/revisions"}],"predecessor-version":[{"id":16716,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/1422\/revisions\/16716"}],"wp:attachment":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/media?parent=1422"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/categories?post=1422"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/tags?post=1422"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}