{"id":11456,"date":"2024-02-28T12:14:45","date_gmt":"2024-02-28T06:44:45","guid":{"rendered":"https:\/\/www.skynats.com\/?p=11456"},"modified":"2025-10-22T11:05:15","modified_gmt":"2025-10-22T05:35:15","slug":"psk-encryption-for-zabbix-agents","status":"publish","type":"post","link":"https:\/\/www.skynats.com\/blog\/psk-encryption-for-zabbix-agents\/","title":{"rendered":"Steps to Enable PSK Encryption For Zabbix Agents"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Pre-Shared Key (PSK) encryption is a method of securing communication between <a href=\"https:\/\/www.zabbix.com\/\" target=\"_blank\" rel=\"noopener\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-secondary-color\">Zabbix<\/mark><\/a> server and Zabbix agents.Enabling PSK encryption in Zabbix provides an extra level of security to your monitoring infrastructure.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-steps-to-enable-psk-encryption-on-zabbix-agent-server\">Steps to enable PSK encryption on Zabbix agent server<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>On zabbix agent server<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1. Generate a PSK secret key in the location \/etc\/zabbix using the command<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>openssl rand -hex 64 &gt; encrypt.psk\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This command generate a 64-byte random hexadecimal string and saves in a file named encrypt.psk<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">2. Then configure zabbix agent configuration file zabbix_agentd.conf<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vim zabbix_agentd.conf\n\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">add the following lines at the bottom of the configuration file<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>TLSConnect=psk\nTLSAccept=psk\nTLSPSKFile=\/etc\/zabbix\/encrypt.psk\nTLSPSKIdentity=bNb*******ouSt<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">where TLSPSK Identity is used by both the agent and server to verify that they are communicating with the correct PSK.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">save and exit the configuration file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">3. Restart the zabbix agent<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl restart zabbix-agent\n\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>On Zabbix Server User interface<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">4. Update the host in zabbix server user interface<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the host&#8217;s encryption section, configure PSK encryption options as shown in the screenshot.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"328\" sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2024\/02\/PSKtest-1024x328.png\" alt=\"Host encryption- PSK encryption\" class=\"wp-image-11458\" srcset=\"https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2024\/02\/PSKtest-1024x328.png 1024w, https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2024\/02\/PSKtest-300x96.png 300w, https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2024\/02\/PSKtest-768x246.png 768w, https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2024\/02\/PSKtest.png 1052w\" \/><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>'Connections to host' = PSK\n'Connections from host' = PSK\n'PSK Identity' = &#91;used in the Zabbix agent configuration file]\n'PSK' = &#91;hexadecimal string generated from the OpenSSL command]<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Wait for few minutes, then the verify on Zabbix Server User interface.<\/p>\n\n\n\n<figure data-wp-context=\"{&quot;imageId&quot;:&quot;6a50df0f335e5&quot;}\" data-wp-interactive=\"core\/image\" data-wp-key=\"6a50df0f335e5\" class=\"wp-block-image size-full is-resized wp-lightbox-container\"><img decoding=\"async\" width=\"1130\" height=\"61\" data-wp-class--hide=\"state.isContentHidden\" data-wp-class--show=\"state.isContentVisible\" data-wp-init=\"callbacks.setButtonStyles\" data-wp-on--click=\"actions.showLightbox\" data-wp-on--load=\"callbacks.setButtonStyles\" data-wp-on--pointerdown=\"actions.preloadImage\" data-wp-on--pointerenter=\"actions.preloadImageWithDelay\" data-wp-on--pointerleave=\"actions.cancelPreload\" data-wp-on-window--resize=\"callbacks.setButtonStyles\" sizes=\"(max-width: 1130px) 100vw, 1130px\" src=\"https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2024\/02\/PSKtest2.png\" alt=\"PSK T encryption enabling\" class=\"wp-image-11459\" style=\"width:610px;height:auto\" srcset=\"https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2024\/02\/PSKtest2.png 1130w, https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2024\/02\/PSKtest2-300x16.png 300w, https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2024\/02\/PSKtest2-1024x55.png 1024w, https:\/\/www.skynats.com\/blog\/wp-content\/uploads\/2024\/02\/PSKtest2-768x41.png 768w\" \/><button\n\t\t\tclass=\"lightbox-trigger\"\n\t\t\ttype=\"button\"\n\t\t\taria-haspopup=\"dialog\"\n\t\t\tdata-wp-bind--aria-label=\"state.thisImage.triggerButtonAriaLabel\"\n\t\t\tdata-wp-init=\"callbacks.initTriggerButton\"\n\t\t\tdata-wp-on--click=\"actions.showLightbox\"\n\t\t\tdata-wp-style--right=\"state.thisImage.buttonRight\"\n\t\t\tdata-wp-style--top=\"state.thisImage.buttonTop\"\n\t\t>\n\t\t\t<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"12\" height=\"12\" fill=\"none\" viewBox=\"0 0 12 12\">\n\t\t\t\t<path fill=\"#fff\" d=\"M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z\" \/>\n\t\t\t<\/svg>\n\t\t<\/button><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The screenshot above confirms that Zabbix Server and Agent successfully communicate via PSK encryption.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Our\u00a0<a href=\"https:\/\/www.skynats.com\/server-management\/\" target=\"_blank\" rel=\"noreferrer noopener\">Support Team<\/a>\u00a0is available to help you with enabling encryption with zabbix agents if you encounter any issues or errors.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Pre-Shared Key (PSK) encryption is a method of securing communication between Zabbix server and Zabbix agents.Enabling PSK encryption in Zabbix provides an extra level of security to your monitoring infrastructure. Steps to enable PSK encryption on Zabbix agent server On zabbix agent server 1. Generate a PSK secret key in the location \/etc\/zabbix using the [&hellip;]<\/p>\n","protected":false},"author":14,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[777,5,391],"tags":[72,106,776],"class_list":["post-11456","post","type-post","status-publish","format-standard","hentry","category-zabbix-monitoring","category-blog","category-server-monitoring","tag-server-management","tag-server-monitoring","tag-zabbix-monitoring"],"_links":{"self":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/11456","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/users\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/comments?post=11456"}],"version-history":[{"count":1,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/11456\/revisions"}],"predecessor-version":[{"id":16139,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/posts\/11456\/revisions\/16139"}],"wp:attachment":[{"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/media?parent=11456"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/categories?post=11456"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.skynats.com\/blog\/wp-json\/wp\/v2\/tags?post=11456"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}