{"id":16289,"date":"2024-10-31T09:39:13","date_gmt":"2024-10-31T09:39:13","guid":{"rendered":"https:\/\/truehost.com\/support\/?post_type=docs&#038;p=16289"},"modified":"2024-10-31T10:16:28","modified_gmt":"2024-10-31T10:16:28","password":"","slug":"how-to-restrict-ssh-access-to-specific-ips-using-hosts-allow-and-hosts-deny","status":"publish","type":"docs","link":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-restrict-ssh-access-to-specific-ips-using-hosts-allow-and-hosts-deny\/","title":{"rendered":"How to Restrict SSH Access to Specific IPs Using hosts.allow and hosts.deny"},"content":{"rendered":"\n<p>Restricting SSH access to specific IPs is a fundamental security practice that limits who can access your server, helping reduce the risk of unauthorized access. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Sudo SSH access to the server; either with user root or sudo user.<\/li>\n<\/ul>\n\n\n\n<p>On Linux systems, you can use the <code>hosts.allow<\/code> and <code>hosts.deny<\/code> files to control access to SSH and other services.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Understanding <code>hosts.allow<\/code> and <code>hosts.deny<\/code><\/h2>\n\n\n\n<p>The <code>hosts.allow<\/code> and <code>hosts.deny<\/code> files are part of TCP Wrappers, a mechanism for filtering incoming connections based on predefined rules. You can specify which IP addresses are allowed or denied access to specific services by configuring these files.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>\/etc\/hosts.allow<\/code><\/strong>: Specifies which IP addresses can access certain services.<\/li>\n\n\n\n<li><strong><code>\/etc\/hosts.deny<\/code><\/strong>: Denies access from IP addresses to services not allowed in <code>hosts.allow<\/code>.<\/li>\n<\/ul>\n\n\n\n<p><strong>Note:<\/strong> TCP Wrappers may not be enabled by default on all systems, so verify compatibility on your Linux distribution.<\/p>\n\n\n\n<p><strong>Step 1: <\/strong> SSH to your server. You can refer to <strong><a href=\"https:\/\/truehost.com\/support\/knowledge-base\/how-to-access-a-server-via-ssh-terminal\/\" target=\"_blank\" rel=\"noreferrer noopener\">this guide.<\/a><\/strong><\/p>\n\n\n\n<p><strong>Step 2: Open <code>hosts.allow<\/code> and <code>hosts.deny<\/code><\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>To start restricting SSH access, edit the configuration files. You can use vi or nano based on your preference.<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo vi \/etc\/hosts.allow\nsudo vi \/etc\/hosts.deny<\/code><\/pre>\n\n\n\n<p><strong>Configure <code>hosts.allow<\/code><\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Access the <code>\/etc\/hosts.allow<\/code> file<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo vi \/etc\/hosts.allow<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Specify the allowed IP addresses. For SSH, add the following line, replacing <code>192.168.1.100<\/code> with the IP address you wish to allow:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sshd: 192.168.1.100<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full is-style-zoooom\"><img loading=\"lazy\" decoding=\"async\" width=\"947\" height=\"403\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-685.png\" alt=\"\" class=\"wp-image-16294\" srcset=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-685.png 947w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-685-300x128.png 300w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-685-768x327.png 768w\" sizes=\"auto, (max-width: 947px) 100vw, 947px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>You can allow multiple IPs by separating them with spaces:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sshd: 192.168.1.100 192.168.1.101 203.0.113.50<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Alternatively, to allow an entire subnet, use CIDR notation or wildcard symbols:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sshd: 192.168.1.0\/24<\/code><\/pre>\n\n\n\n<p><strong>Configure <code>hosts.deny<\/code><\/strong><\/p>\n\n\n\n<p><span style=\"font-size: revert; color: initial;\">Access <\/span><code style=\"background-color: rgb(255, 255, 255);\">\/etc\/hosts.deny<\/code><span style=\"font-size: revert; color: initial;\">, <\/span><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo vi \/etc\/hosts.deny<\/code><\/pre>\n\n\n\n<p><span style=\"font-size: revert; color: initial;\">deny all other IP addresses by adding this line:<\/span><pre class=\"!overflow-visible\"><div class=\"contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950\"><div class=\"flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary\"><\/div><\/div><\/pre><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sshd: ALL<\/code><\/pre>\n\n\n\n<p>This line blocks all SSH access by default, except for those IPs explicitly allowed in <code>hosts.allow<\/code>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-zoooom\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"480\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-686-1024x480.png\" alt=\"\" class=\"wp-image-16299\" srcset=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-686-1024x480.png 1024w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-686-300x141.png 300w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-686-768x360.png 768w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-686.png 1059w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>Step 3: Verify TCP Wrappers Support (optional)<\/strong><\/p>\n\n\n\n<p>On some distributions, you may need to verify that TCP Wrappers is installed and supported. Install the necessary package if it\u2019s not present:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># On RHEL-based systems\nsudo yum install tcp_wrappers\n\n# On Debian-based systems\nsudo apt install tcpd<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"506\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-687-1024x506.png\" alt=\"\" class=\"wp-image-16300\" srcset=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-687-1024x506.png 1024w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-687-300x148.png 300w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-687-768x379.png 768w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-687.png 1105w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>Step 4: Test the Configuration<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Once configured, test the setup by attempting to SSH from allowed and disallowed IP addresses to ensure the rules work as expected.<\/li>\n<\/ul>\n\n\n\n<p>Below image shows successful connection from an allowed IP\/network<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"612\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-688-1024x612.png\" alt=\"\" class=\"wp-image-16301\" srcset=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-688-1024x612.png 1024w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-688-300x179.png 300w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-688-768x459.png 768w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-688.png 1172w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Below image shows unsuccessful connection from a denied IP\/network<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"257\" src=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-689-1024x257.png\" alt=\"\" class=\"wp-image-16302\" srcset=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-689-1024x257.png 1024w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-689-300x75.png 300w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-689-768x193.png 768w, https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-689.png 1066w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><strong>Example Configuration<\/strong><\/p>\n\n\n\n<p>Here&#8217;s an example of how the files might look:<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><code>\/etc\/hosts.allow<\/code><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>sshd: 192.168.1.100 192.168.1.101 203.0.113.50<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><code>\/etc\/hosts.deny<\/code><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>sshd: ALL<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Author&#8217;s final word<\/h2>\n\n\n\n<p>Using <code>hosts.allow<\/code> and <code>hosts.deny<\/code> is an effective way to restrict SSH access to specific IPs on Linux servers. By configuring these files, you can create a robust layer of security for your server\u2019s SSH access, helping to protect your system from unauthorized login attempts.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Restricting SSH access to specific IPs is a fundamental security practice that limits who can access your server, helping reduce the risk of unauthorized access. Prerequisites On Linux systems, you can use the hosts.allow and hosts.deny files to control access to SSH and other services. Understanding hosts.allow and hosts.deny The hosts.allow and hosts.deny files are [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"_eb_attr":"","_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"doc_category":[1820,1824,1879,2128],"doc_tag":[],"class_list":["post-16289","docs","type-docs","status-publish","hentry","doc_category-cloud-servers-in-kenya","doc_category-dedicated-servers","doc_category-servers","doc_category-vps-servers"],"year_month":"2026-07","word_count":458,"total_views":0,"reactions":{"happy":0,"normal":0,"sad":0},"author_info":{"name":"Eugene","author_nicename":"eugene","author_url":"https:\/\/truehost.com\/support\/author\/eugene\/"},"doc_category_info":[{"term_name":"Cloud servers in Kenya","term_url":"https:\/\/truehost.com\/support\/docs-category\/cloud-servers-in-kenya\/"},{"term_name":"dedicated servers","term_url":"https:\/\/truehost.com\/support\/docs-category\/dedicated-servers\/"},{"term_name":"Servers","term_url":"https:\/\/truehost.com\/support\/docs-category\/servers\/"},{"term_name":"VPS-Servers","term_url":"https:\/\/truehost.com\/support\/docs-category\/vps-servers\/"}],"doc_tag_info":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Restrict SSH Access to Specific IPs Using hosts.allow and hosts.deny -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/truehost.com\/support\/knowledge-base\/how-to-restrict-ssh-access-to-specific-ips-using-hosts-allow-and-hosts-deny\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Restrict SSH Access to Specific IPs Using hosts.allow and hosts.deny -\" \/>\n<meta property=\"og:description\" content=\"Restricting SSH access to specific IPs is a fundamental security practice that limits who can access your server, helping reduce the risk of unauthorized access. Prerequisites On Linux systems, you can use the hosts.allow and hosts.deny files to control access to SSH and other services. Understanding hosts.allow and hosts.deny The hosts.allow and hosts.deny files are [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/truehost.com\/support\/knowledge-base\/how-to-restrict-ssh-access-to-specific-ips-using-hosts-allow-and-hosts-deny\/\" \/>\n<meta property=\"article:modified_time\" content=\"2024-10-31T10:16:28+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-685.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-restrict-ssh-access-to-specific-ips-using-hosts-allow-and-hosts-deny\\\/\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-restrict-ssh-access-to-specific-ips-using-hosts-allow-and-hosts-deny\\\/\",\"name\":\"How to Restrict SSH Access to Specific IPs Using hosts.allow and hosts.deny -\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-restrict-ssh-access-to-specific-ips-using-hosts-allow-and-hosts-deny\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-restrict-ssh-access-to-specific-ips-using-hosts-allow-and-hosts-deny\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/image-685.png\",\"datePublished\":\"2024-10-31T09:39:13+00:00\",\"dateModified\":\"2024-10-31T10:16:28+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-restrict-ssh-access-to-specific-ips-using-hosts-allow-and-hosts-deny\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-restrict-ssh-access-to-specific-ips-using-hosts-allow-and-hosts-deny\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-restrict-ssh-access-to-specific-ips-using-hosts-allow-and-hosts-deny\\\/#primaryimage\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/image-685.png\",\"contentUrl\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/image-685.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/knowledge-base\\\/how-to-restrict-ssh-access-to-specific-ips-using-hosts-allow-and-hosts-deny\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/truehost.com\\\/support\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Restrict SSH Access to Specific IPs Using hosts.allow and hosts.deny\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#website\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/\",\"name\":\"\",\"description\":\"Help In a Click\",\"publisher\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/truehost.com\\\/support\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#organization\",\"name\":\"Truehost Kenya\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/cropped-image_2026-04-16_174808866.png\",\"contentUrl\":\"https:\\\/\\\/truehost.com\\\/support\\\/wp-content\\\/uploads\\\/2026\\\/04\\\/cropped-image_2026-04-16_174808866.png\",\"width\":240,\"height\":48,\"caption\":\"Truehost Kenya\"},\"image\":{\"@id\":\"https:\\\/\\\/truehost.com\\\/support\\\/#\\\/schema\\\/logo\\\/image\\\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Restrict SSH Access to Specific IPs Using hosts.allow and hosts.deny -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-restrict-ssh-access-to-specific-ips-using-hosts-allow-and-hosts-deny\/","og_locale":"en_US","og_type":"article","og_title":"How to Restrict SSH Access to Specific IPs Using hosts.allow and hosts.deny -","og_description":"Restricting SSH access to specific IPs is a fundamental security practice that limits who can access your server, helping reduce the risk of unauthorized access. Prerequisites On Linux systems, you can use the hosts.allow and hosts.deny files to control access to SSH and other services. Understanding hosts.allow and hosts.deny The hosts.allow and hosts.deny files are [&hellip;]","og_url":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-restrict-ssh-access-to-specific-ips-using-hosts-allow-and-hosts-deny\/","article_modified_time":"2024-10-31T10:16:28+00:00","og_image":[{"url":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-685.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-restrict-ssh-access-to-specific-ips-using-hosts-allow-and-hosts-deny\/","url":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-restrict-ssh-access-to-specific-ips-using-hosts-allow-and-hosts-deny\/","name":"How to Restrict SSH Access to Specific IPs Using hosts.allow and hosts.deny -","isPartOf":{"@id":"https:\/\/truehost.com\/support\/#website"},"primaryImageOfPage":{"@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-restrict-ssh-access-to-specific-ips-using-hosts-allow-and-hosts-deny\/#primaryimage"},"image":{"@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-restrict-ssh-access-to-specific-ips-using-hosts-allow-and-hosts-deny\/#primaryimage"},"thumbnailUrl":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-685.png","datePublished":"2024-10-31T09:39:13+00:00","dateModified":"2024-10-31T10:16:28+00:00","breadcrumb":{"@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-restrict-ssh-access-to-specific-ips-using-hosts-allow-and-hosts-deny\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/truehost.com\/support\/knowledge-base\/how-to-restrict-ssh-access-to-specific-ips-using-hosts-allow-and-hosts-deny\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-restrict-ssh-access-to-specific-ips-using-hosts-allow-and-hosts-deny\/#primaryimage","url":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-685.png","contentUrl":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2024\/10\/image-685.png"},{"@type":"BreadcrumbList","@id":"https:\/\/truehost.com\/support\/knowledge-base\/how-to-restrict-ssh-access-to-specific-ips-using-hosts-allow-and-hosts-deny\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/truehost.com\/support\/"},{"@type":"ListItem","position":2,"name":"How to Restrict SSH Access to Specific IPs Using hosts.allow and hosts.deny"}]},{"@type":"WebSite","@id":"https:\/\/truehost.com\/support\/#website","url":"https:\/\/truehost.com\/support\/","name":"","description":"Help In a Click","publisher":{"@id":"https:\/\/truehost.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/truehost.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/truehost.com\/support\/#organization","name":"Truehost Kenya","url":"https:\/\/truehost.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/truehost.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2026\/04\/cropped-image_2026-04-16_174808866.png","contentUrl":"https:\/\/truehost.com\/support\/wp-content\/uploads\/2026\/04\/cropped-image_2026-04-16_174808866.png","width":240,"height":48,"caption":"Truehost Kenya"},"image":{"@id":"https:\/\/truehost.com\/support\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs\/16289","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/comments?post=16289"}],"version-history":[{"count":5,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs\/16289\/revisions"}],"predecessor-version":[{"id":16303,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/docs\/16289\/revisions\/16303"}],"wp:attachment":[{"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/media?parent=16289"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/doc_category?post=16289"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/truehost.com\/support\/wp-json\/wp\/v2\/doc_tag?post=16289"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}