{"id":14898,"date":"2025-10-28T22:38:15","date_gmt":"2025-10-29T04:38:15","guid":{"rendered":"https:\/\/www.supportpro.com\/blog\/?p=14898"},"modified":"2025-10-28T22:41:06","modified_gmt":"2025-10-29T04:41:06","slug":"how-to-use-cpguard-cli-for-powerful-server-protection","status":"publish","type":"post","link":"https:\/\/www.supportpro.com\/blog\/how-to-use-cpguard-cli-for-powerful-server-protection\/","title":{"rendered":"How to Use CPGuard CLI for Powerful Server Protection"},"content":{"rendered":"\n<p>If you\u2019ve ever wrangled a server or run your own hosting setup, you already know: security isn\u2019t optional. You need solid protection, and that\u2019s where CPGuard comes in. It\u2019s a tough, feature-packed security suite built for web servers. Sure, it plays nice with control panels like cPanel and DirectAdmin, but what really sets it apart for power users is the Command Line Interface\u2014the CLI. If you like working straight from the terminal, this is your playground.<\/p>\n\n\n\n<p>Let\u2019s dig in. I\u2019ll show you how to get around the CPGuard CLI, use the most important commands, and handle your security setup without breaking a sweat.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p><strong>Why bother with the CLI?<\/strong><\/p>\n\n\n\n<p>Look, the CPGuard web interface is clean and user-friendly. But if you\u2019re a sysadmin, or you\u2019re juggling a bunch of servers, the CLI gives you the kind of fast, direct control you need. With it, you can:<\/p>\n\n\n\n<div class=\"wp-block-group is-vertical is-layout-flex wp-container-core-group-is-layout-8cf370e7 wp-block-group-is-layout-flex\">\n<p>&#8211; Check malware scans as they happen<\/p>\n\n\n\n<p>&#8211; Manage quarantined files<\/p>\n\n\n\n<p>&#8211; Update malware definitions and rules<\/p>\n\n\n\n<p>&#8211; Restart services<\/p>\n\n\n\n<p>&#8211; Check your system\u2019s status in seconds<\/p>\n\n\n\n<p>And if you\u2019re into scripting or automation, the CLI is a must.<\/p>\n<\/div>\n\n\n\n<p>Getting Started<\/p>\n\n\n\n<p>Once you\u2019ve installed CPGuard, fire up the CLI with:<\/p>\n\n\n\n<p>cpguard<\/p>\n\n\n\n<p>You\u2019ll see a list of available subcommands. Or tack on the help flag to see more options:<\/p>\n\n\n\n<p>cpguard &#8211;help<\/p>\n\n\n\n<p>You\u2019ll get something like this:<\/p>\n\n\n\n<p>Usage: cpguard [options] [command]<\/p>\n\n\n\n<p>Options:<\/p>\n\n\n\n<div class=\"wp-block-group is-vertical is-layout-flex wp-container-core-group-is-layout-8cf370e7 wp-block-group-is-layout-flex\">\n<p>&nbsp;-v, &#8211;version &nbsp; Show version<\/p>\n\n\n\n<p>&nbsp;-h, &#8211;help&nbsp; &nbsp; &nbsp; Show help message<\/p>\n<\/div>\n\n\n\n<p>Commands:<\/p>\n\n\n\n<div class=\"wp-block-group is-vertical is-layout-flex wp-container-core-group-is-layout-8cf370e7 wp-block-group-is-layout-flex\">\n<p>&nbsp;scan&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Scan files or directories<\/p>\n\n\n\n<p>&nbsp;quarantine&nbsp; &nbsp; &nbsp; Manage quarantined files<\/p>\n\n\n\n<p>&nbsp;update&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Update definitions<\/p>\n\n\n\n<p>&nbsp;status&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Check CPGuard service status<\/p>\n\n\n\n<p>&nbsp;logs&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; View scan and activity logs<\/p>\n\n\n\n<p>&nbsp;license &nbsp; &nbsp; &nbsp; &nbsp; Manage license<\/p>\n<\/div>\n\n\n\n<p>Now, let\u2019s break down the commands you\u2019ll actually use day to day.<\/p>\n\n\n\n<p><strong>1. Checking Service Status<\/strong><\/p>\n\n\n\n<p>Want to see if CPGuard is running? Easy:<\/p>\n\n\n\n<p>cpguard status<\/p>\n\n\n\n<p>You\u2019ll get the current status of the CPGuard daemon and related services. If it says \u201cactive\u201d or \u201crunning,\u201d you\u2019re all set.<\/p>\n\n\n\n<p><strong>2. Running a Malware Scan<\/strong><\/p>\n\n\n\n<p>Malware scanning is the heart of CPGuard. To kick off a scan for a directory or file, just do:<\/p>\n\n\n\n<p>cpguard scan \/home\/username\/public_html<\/p>\n\n\n\n<p>You can customize the scan with flags:<\/p>\n\n\n\n<div class=\"wp-block-group is-vertical is-layout-flex wp-container-core-group-is-layout-8cf370e7 wp-block-group-is-layout-flex\">\n<p>&#8211;quick&nbsp; &nbsp; &nbsp; Run a fast scan that uses fewer resources<\/p>\n\n\n\n<p>&#8211;full &nbsp; &nbsp; &nbsp; Dig deep\u2014scan every file<\/p>\n\n\n\n<p>&#8211;path=\/path\/to\/dir &nbsp; Point it to a specific directory<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>During or after the scan, CPGuard will flag any suspicious or infected files, and if you\u2019ve set it up that way, quarantine them automatically.<\/p>\n<\/div>\n\n\n\n<p><strong>3. Managing Quarantined Files<\/strong><\/p>\n\n\n\n<p>Found something nasty? CPGuard throws it into quarantine. To see what\u2019s locked away:<\/p>\n\n\n\n<p>cpguard quarantine list<\/p>\n\n\n\n<p>Want to restore a file from quarantine?<\/p>\n\n\n\n<p>cpguard quarantine restore &lt;filename&gt;<\/p>\n\n\n\n<p>Ready to get rid of something for good?<\/p>\n\n\n\n<p>cpguard quarantine delete &lt;filename&gt;<\/p>\n\n\n\n<p>Always double-check before deleting\u2014sometimes a harmless file gets flagged by accident.<\/p>\n\n\n\n<p><strong>4. Updating Signatures and Definitions<\/strong><\/p>\n\n\n\n<p>Security tools are only as good as their latest updates. To make sure your definitions are fresh:<\/p>\n\n\n\n<p>cpguard update<\/p>\n\n\n\n<p>This pulls down the newest definitions and rules from CPGuard\u2019s servers. Set it up with a cron job and you\u2019ll never worry about falling behind.<\/p>\n\n\n\n<p><strong>5. Viewing Logs<\/strong><\/p>\n\n\n\n<p>When stuff goes sideways, logs are where you look. To check recent scan or activity logs:<\/p>\n\n\n\n<p>cpguard logs<\/p>\n\n\n\n<p>You can filter by category or severity. That way, you see when scans ran, what got detected, or if an update failed.<\/p>\n\n\n\n<p>Want to dig in deeper? All logs are stored here:<\/p>\n\n\n\n<p>\/usr\/local\/cpguard\/logs\/<\/p>\n\n\n\n<p>Check them out manually, or watch them live:<\/p>\n\n\n\n<p>tail -f \/usr\/local\/cpguard\/logs\/scan.log<\/p>\n\n\n\n<p><strong>6. License Management<\/strong><\/p>\n\n\n\n<p>Need to check your license?<\/p>\n\n\n\n<p>cpguard license<\/p>\n\n\n\n<p>You\u2019ll see your license key, when it expires, and its status. Got a new key? Update it like this:<\/p>\n\n\n\n<p>cpguard license &#8211;update &lt;your_license_key&gt;<\/p>\n\n\n\n<p>Keeps your install running without any interruptions.<\/p>\n\n\n\n<p><strong>Wrapping Up<\/strong><\/p>\n\n\n\n<p>That\u2019s your starter kit for the CPGuard CLI. It\u2019s fast, flexible, and made for admins who want <a href=\"https:\/\/www.supportpro.com\/freecheckup.php\" title=\"\">hands-on control<\/a>\u2014no web panel required. Also, experts at SupportPRO are just a <a href=\"https:\/\/www.supportpro.com\/softwareinstallation.php\" title=\"\">click <\/a>away for any <a href=\"https:\/\/www.supportpro.com\/dedicatedstaff.php\" title=\"\">assistance <\/a>you may need with <a href=\"https:\/\/www.supportpro.com\/blog\/how-to-use-cpguard-cli-for-powerful-server-protection\/\" title=\"\">CPGuard<\/a>.<\/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\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you\u2019ve ever wrangled a server or run your own hosting setup, you already know: security isn\u2019t optional. You need solid protection, and that\u2019s where CPGuard comes in. It\u2019s a&hellip;<\/p>\n","protected":false},"author":4,"featured_media":14899,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[66,194,316],"tags":[],"class_list":["post-14898","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cpanel","category-dedicated-server-support","category-security"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/14898","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\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/comments?post=14898"}],"version-history":[{"count":3,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/14898\/revisions"}],"predecessor-version":[{"id":14902,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/14898\/revisions\/14902"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/media\/14899"}],"wp:attachment":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/media?parent=14898"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/categories?post=14898"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/tags?post=14898"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}