{"id":21358,"date":"2025-11-25T08:43:17","date_gmt":"2025-11-25T08:43:17","guid":{"rendered":"https:\/\/www.webhosting.uk.com\/kb\/?p=21358"},"modified":"2026-06-03T10:18:01","modified_gmt":"2026-06-03T10:18:01","slug":"how-to-change-the-ssh-port-to-enhance-server-security","status":"publish","type":"post","link":"https:\/\/www.webhosting.uk.com\/kb\/how-to-change-the-ssh-port-to-enhance-server-security\/","title":{"rendered":"How to Change the SSH Port to Enhance Server Security"},"content":{"rendered":"<p>Changing the default SSH port (22) is a simple but effective security measure that helps reduce automated attacks and unauthorised access attempts. This guide explains how to safely change your SSH port on a Linux server and avoid lockouts.<\/p>\n<div class=\"more-tab-content\">\n<h2><strong>Table of Contents<\/strong><\/h2>\n<ol>\n<li><a href=\"#port\">Why Change the SSH Port?<\/a><\/li>\n<li><a href=\"#prerequisites\">Prerequisites<\/a><\/li>\n<li><a href=\"#change\">Steps to Change the SSH Port<\/a><a name=\"port\"><\/a><\/li>\n<li><a href=\"#troubleshooting\">Troubleshooting<\/a><\/li>\n<li><a href=\"#practices\">Security Best Practices<\/a><\/li>\n<li><a href=\"#conclusion\">Conclusion<\/a><\/li>\n<\/ol>\n<\/div>\n<h3><strong>Why Change the SSH Port?<\/strong><\/h3>\n<p>By default, all Linux servers use port 22 for SSH. Attackers often scan this port to attempt brute-force logins.<\/p>\n<p>Changing <a name=\"prerequisites\"><\/a>the port:<\/p>\n<ul>\n<li>Reduces automated bot attacks<\/li>\n<li>Adds a basic layer of protection<\/li>\n<li>Helps secure the server from common vulnerabilities<\/li>\n<\/ul>\n<h3><strong>Prerequisites<\/strong><\/h3>\n<p>Before starting:<\/p>\n<ul>\n<li>Ensure you have root or sudo access<\/li>\n<li>Take a server backup or snapshot<\/li>\n<li>Keep your terminal <a name=\"change\"><\/a>session open until testing the new port<\/li>\n<li>Make sure your firewall allows the new port<\/li>\n<\/ul>\n<h3><strong>Steps to Change the SSH Port<\/strong><\/h3>\n<p>Step 1: Choose a New SSH Port<\/p>\n<ol>\n<li>Select a port between:<br \/>\n1024 \u2013 65535<\/li>\n<li>Avoid using commonly used ports like 80, 443, 3306, etc.<\/li>\n<li>Example:<br \/>\nUse 2222 or 49152<\/li>\n<\/ol>\n<p>Step 2: Update the SSH Configuration<\/p>\n<ol>\n<li>Open the SSH config file:\n<pre>sudo nano \/etc\/ssh\/sshd_config<\/pre>\n<\/li>\n<li>Find the line:\n<pre>#Port 22<\/pre>\n<\/li>\n<li>Uncomment it and change to your new port:\n<pre>Port 2222<\/pre>\n<\/li>\n<li>Save and exit.<\/li>\n<\/ol>\n<p>Step 3: Adjust Firewall Rules<\/p>\n<ol>\n<li>For UFW\n<pre>sudo ufw allow 2222\/tcp\r\nsudo ufw delete allow 22\/tcp<\/pre>\n<\/li>\n<li>For firewalld\n<pre>sudo firewall-cmd --add-port=2222\/tcp \u2013permanent\r\nsudo firewall-cmd --remove-port=22\/tcp \u2013permanent\r\nsudo firewall-cmd \u2013reload<\/pre>\n<\/li>\n<li>For iptables\n<pre>sudo iptables -A INPUT -p tcp --dport 2222 -j ACCEPT\r\nsudo iptables -A INPUT -p tcp --dport 22 -j DROP<\/pre>\n<\/li>\n<\/ol>\n<p>Step 4: Restart SSH Service<\/p>\n<ol>\n<li>Restart SSH to apply changes:\n<pre>sudo systemctl restart sshd<\/pre>\n<\/li>\n<li>For CentOS\/RHEL:\n<pre>sudo systemctl restart sshd.service<\/pre>\n<\/li>\n<\/ol>\n<p>Step 5: Test the New SSH Port<\/p>\n<p>Open a new terminal window <a name=\"troubleshooting\"><\/a>(keep the old one open in case of errors):<\/p>\n<pre>ssh -p 2222 user@your_server_ip<\/pre>\n<p>If the login is successful, the new port is active.<\/p>\n<h3><strong>Troubleshooting<\/strong><\/h3>\n<p>Cannot Connect After Changing Port?<\/p>\n<ul>\n<li>Check if the firewall allows the new port.<\/li>\n<li>Ensure SSH config <a name=\"practices\"><\/a>syntax is correct:\n<pre>sudo sshd -t<\/pre>\n<\/li>\n<li>Revert the port change using console or KVM access.<\/li>\n<\/ul>\n<h3><strong>Security Best Practices (Recommended)<\/strong><\/h3>\n<p>After changing the SSH port, also implement the following security measures:<\/p>\n<ol>\n<li>Disable root login to prevent unauthorised direct access.<\/li>\n<li>Use SSH key-based authentication instead of passwords.<\/li>\n<li>Enable Fail2Ban to block repeated failed login attempts.<\/li>\n<li>Restrict SSH <a name=\"conclusion\"><\/a>access by IP (allow trusted IPs only).<\/li>\n<li>Keep all server packages and security patches up to date.<\/li>\n<\/ol>\n<h3><strong>Conclusion<\/strong><\/h3>\n<p>In this manner, changing your SSH port adds an extra layer of protection against automated attacks. Combine it with key security measures, SSH keys, disabling root login, Fail2Ban, and regular updates, to keep your server secure and stable.<\/p>\n<p>If you need any help, our support team is always available to assist you.<\/p>\n<div style=\"background: #E6F0FF; padding: 15px; border-left: 4px solid #0047BA; margin: 20px 0;\"><strong>Strengthening SSH security and server access control?<\/strong><br \/>\nA <a href=\"https:\/\/www.webhosting.uk.com\/linux-vps\">Linux VPS Hosting<\/a> solution provides full root access and the flexibility needed to manage SSH settings, firewall rules and secure remote administration.<\/div>\n<p style=\"text-align: center;\"><em><strong>Want to go further with SSH security? Learn <a href=\"https:\/\/www.webhosting.uk.com\/kb\/how-to-modify-the-ssh-server-port-number\/\"> How to modify the SSH server port number<\/a><\/strong><\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Changing the default SSH port (22) is a simple but effective security measure that helps reduce automated attacks and unauthorised access attempts. This guide explains how to safely change your&hellip;<\/p>\n<p><a href=\"https:\/\/www.webhosting.uk.com\/kb\/how-to-change-the-ssh-port-to-enhance-server-security\/\" class=\"more-link\">Read More<\/a><\/p>\n<div class='heateorSssClear'><\/div><div  class='heateor_sss_sharing_container heateor_sss_horizontal_sharing' data-heateor-sss-href='https:\/\/www.webhosting.uk.com\/kb\/how-to-change-the-ssh-port-to-enhance-server-security\/'><div class='heateor_sss_sharing_title' style=\"font-weight:bold\" >Spread the love<\/div><div class=\"heateor_sss_sharing_ul\"><a aria-label=\"Facebook\" class=\"heateor_sss_facebook\" href=\"https:\/\/www.facebook.com\/sharer\/sharer.php?u=https%3A%2F%2Fwww.webhosting.uk.com%2Fkb%2Fhow-to-change-the-ssh-port-to-enhance-server-security%2F\" title=\"Facebook\" rel=\"nofollow noopener\" target=\"_blank\" style=\"font-size:32px!important;box-shadow:none;display:inline-block;vertical-align:middle\"><span class=\"heateor_sss_svg\" style=\"background-color:#0765FE;width:40px;height:40px;display:inline-block;opacity:1;float:left;font-size:32px;box-shadow:none;display:inline-block;font-size:16px;padding:0 4px;vertical-align:middle;background-repeat:repeat;overflow:hidden;padding:0;cursor:pointer;box-sizing:content-box\"><svg style=\"display:block;\" focusable=\"false\" aria-hidden=\"true\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"100%\" height=\"100%\" viewBox=\"0 0 32 32\"><path fill=\"#fff\" d=\"M28 16c0-6.627-5.373-12-12-12S4 9.373 4 16c0 5.628 3.875 10.35 9.101 11.647v-7.98h-2.474V16H13.1v-1.58c0-4.085 1.849-5.978 5.859-5.978.76 0 2.072.15 2.608.298v3.325c-.283-.03-.775-.045-1.386-.045-1.967 0-2.728.745-2.728 2.683V16h3.92l-.673 3.667h-3.247v8.245C23.395 27.195 28 22.135 28 16Z\"><\/path><\/svg><\/span><\/a><a aria-label=\"X\" class=\"heateor_sss_button_x\" href=\"https:\/\/twitter.com\/intent\/tweet?text=How%20to%20Change%20the%20SSH%20Port%20to%20Enhance%20Server%20Security&url=https%3A%2F%2Fwww.webhosting.uk.com%2Fkb%2Fhow-to-change-the-ssh-port-to-enhance-server-security%2F\" title=\"X\" rel=\"nofollow noopener\" target=\"_blank\" style=\"font-size:32px!important;box-shadow:none;display:inline-block;vertical-align:middle\"><span class=\"heateor_sss_svg heateor_sss_s__default heateor_sss_s_x\" style=\"background-color:#2a2a2a;width:40px;height:40px;display:inline-block;opacity:1;float:left;font-size:32px;box-shadow:none;display:inline-block;font-size:16px;padding:0 4px;vertical-align:middle;background-repeat:repeat;overflow:hidden;padding:0;cursor:pointer;box-sizing:content-box\"><svg width=\"100%\" height=\"100%\" style=\"display:block;\" focusable=\"false\" aria-hidden=\"true\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 32 32\"><path fill=\"#fff\" d=\"M21.751 7h3.067l-6.7 7.658L26 25.078h-6.172l-4.833-6.32-5.531 6.32h-3.07l7.167-8.19L6 7h6.328l4.37 5.777L21.75 7Zm-1.076 16.242h1.7L11.404 8.74H9.58l11.094 14.503Z\"><\/path><\/svg><\/span><\/a><a aria-label=\"Linkedin\" class=\"heateor_sss_button_linkedin\" href=\"https:\/\/www.linkedin.com\/sharing\/share-offsite\/?url=https%3A%2F%2Fwww.webhosting.uk.com%2Fkb%2Fhow-to-change-the-ssh-port-to-enhance-server-security%2F\" title=\"Linkedin\" rel=\"nofollow noopener\" target=\"_blank\" style=\"font-size:32px!important;box-shadow:none;display:inline-block;vertical-align:middle\"><span class=\"heateor_sss_svg heateor_sss_s__default heateor_sss_s_linkedin\" style=\"background-color:#0077b5;width:40px;height:40px;display:inline-block;opacity:1;float:left;font-size:32px;box-shadow:none;display:inline-block;font-size:16px;padding:0 4px;vertical-align:middle;background-repeat:repeat;overflow:hidden;padding:0;cursor:pointer;box-sizing:content-box\"><svg style=\"display:block;\" focusable=\"false\" aria-hidden=\"true\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"100%\" height=\"100%\" viewBox=\"0 0 32 32\"><path d=\"M6.227 12.61h4.19v13.48h-4.19V12.61zm2.095-6.7a2.43 2.43 0 0 1 0 4.86c-1.344 0-2.428-1.09-2.428-2.43s1.084-2.43 2.428-2.43m4.72 6.7h4.02v1.84h.058c.56-1.058 1.927-2.176 3.965-2.176 4.238 0 5.02 2.792 5.02 6.42v7.395h-4.183v-6.56c0-1.564-.03-3.574-2.178-3.574-2.18 0-2.514 1.7-2.514 3.46v6.668h-4.187V12.61z\" fill=\"#fff\"><\/path><\/svg><\/span><\/a><\/div><div class=\"heateorSssClear\"><\/div><\/div><div class='heateorSssClear'><\/div>","protected":false},"author":28,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[972],"tags":[1855],"class_list":["post-21358","post","type-post","status-publish","format-standard","hentry","category-security","tag-ssh"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.9 (Yoast SEO v27.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to Change the SSH Port for Better Linux Server Security<\/title>\n<meta name=\"description\" content=\"Learn how to change the default SSH port in Linux to reduce attacks and enhance server security. Follow our step-by-step guide.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webhosting.uk.com\/kb\/how-to-change-the-ssh-port-to-enhance-server-security\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Change the SSH Port to Enhance Server Security\" \/>\n<meta property=\"og:description\" content=\"Learn how to change the default SSH port in Linux to reduce attacks and enhance server security. Follow our step-by-step guide.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webhosting.uk.com\/kb\/how-to-change-the-ssh-port-to-enhance-server-security\/\" \/>\n<meta property=\"og:site_name\" content=\"Webhosting UK Knowledge Base\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webhostingukcom\" \/>\n<meta property=\"article:published_time\" content=\"2025-11-25T08:43:17+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-06-03T10:18:01+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webhosting.uk.com\/kb\/wp-content\/uploads\/2025\/11\/How-to-Change-the-SSH-Port-to-Enhance-Server-Security-1200.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Victor G\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"How to Change the SSH Port to Enhance Server Security\" \/>\n<meta name=\"twitter:description\" content=\"Learn how to change the default SSH port in Linux to reduce attacks and enhance server security. Follow our step-by-step guide.\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.webhosting.uk.com\/kb\/wp-content\/uploads\/2025\/11\/How-to-Change-the-SSH-Port-to-Enhance-Server-Security-1200.png\" \/>\n<meta name=\"twitter:creator\" content=\"@WebhostingUKcom\" \/>\n<meta name=\"twitter:site\" content=\"@WebhostingUKcom\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/how-to-change-the-ssh-port-to-enhance-server-security\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/how-to-change-the-ssh-port-to-enhance-server-security\\\/\"},\"author\":{\"name\":\"Victor G\",\"@id\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/#\\\/schema\\\/person\\\/ea067684eae84c2b8b49a81c69407297\"},\"headline\":\"How to Change the SSH Port to Enhance Server Security\",\"datePublished\":\"2025-11-25T08:43:17+00:00\",\"dateModified\":\"2026-06-03T10:18:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/how-to-change-the-ssh-port-to-enhance-server-security\\\/\"},\"wordCount\":434,\"publisher\":{\"@id\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/#organization\"},\"keywords\":[\"ssh\"],\"articleSection\":[\"Security and Backups\"],\"inLanguage\":\"en-GB\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/how-to-change-the-ssh-port-to-enhance-server-security\\\/\",\"url\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/how-to-change-the-ssh-port-to-enhance-server-security\\\/\",\"name\":\"How to Change the SSH Port for Better Linux Server Security\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/#website\"},\"datePublished\":\"2025-11-25T08:43:17+00:00\",\"dateModified\":\"2026-06-03T10:18:01+00:00\",\"description\":\"Learn how to change the default SSH port in Linux to reduce attacks and enhance server security. Follow our step-by-step guide.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/how-to-change-the-ssh-port-to-enhance-server-security\\\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/how-to-change-the-ssh-port-to-enhance-server-security\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/how-to-change-the-ssh-port-to-enhance-server-security\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Change the SSH Port to Enhance Server Security\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/#website\",\"url\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/\",\"name\":\"Webhosting UK Knowledge Base\",\"description\":\"Expert Insights on Hosting, Development, Security, Marketing, and SEO\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/#organization\"},\"alternateName\":\"WHUK\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/#organization\",\"name\":\"Webhosting UK\",\"alternateName\":\"WHUK\",\"url\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/WHUK-logo-1.png\",\"contentUrl\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/WHUK-logo-1.png\",\"width\":1200,\"height\":628,\"caption\":\"Webhosting UK\"},\"image\":{\"@id\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/webhostingukcom\",\"https:\\\/\\\/x.com\\\/WebhostingUKcom\",\"https:\\\/\\\/www.youtube.com\\\/c\\\/webhostinguk\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/webhosting-uk-com-ltd\\\/\",\"https:\\\/\\\/www.instagram.com\\\/webhosting_uk\\\/\",\"https:\\\/\\\/www.tiktok.com\\\/@webhostinguk\"],\"description\":\"Fast, reliable, and cost-effective website hosting services with Webhosting UK. Committed to providing you secure support around the clock.\",\"email\":\"sales@webhosting.uk.com\",\"telephone\":\"0800 862 0890\",\"legalName\":\"Webhosting UK\",\"foundingDate\":\"2001-02-07\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"51\",\"maxValue\":\"200\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.webhosting.uk.com\\\/kb\\\/#\\\/schema\\\/person\\\/ea067684eae84c2b8b49a81c69407297\",\"name\":\"Victor G\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9bf0713adcbaded4878508c93d93927ecbfa4f74548fd9bcee41478d8768bd66?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9bf0713adcbaded4878508c93d93927ecbfa4f74548fd9bcee41478d8768bd66?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9bf0713adcbaded4878508c93d93927ecbfa4f74548fd9bcee41478d8768bd66?s=96&d=mm&r=g\",\"caption\":\"Victor G\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Change the SSH Port for Better Linux Server Security","description":"Learn how to change the default SSH port in Linux to reduce attacks and enhance server security. Follow our step-by-step guide.","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:\/\/www.webhosting.uk.com\/kb\/how-to-change-the-ssh-port-to-enhance-server-security\/","og_locale":"en_GB","og_type":"article","og_title":"How to Change the SSH Port to Enhance Server Security","og_description":"Learn how to change the default SSH port in Linux to reduce attacks and enhance server security. Follow our step-by-step guide.","og_url":"https:\/\/www.webhosting.uk.com\/kb\/how-to-change-the-ssh-port-to-enhance-server-security\/","og_site_name":"Webhosting UK Knowledge Base","article_publisher":"https:\/\/www.facebook.com\/webhostingukcom","article_published_time":"2025-11-25T08:43:17+00:00","article_modified_time":"2026-06-03T10:18:01+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/www.webhosting.uk.com\/kb\/wp-content\/uploads\/2025\/11\/How-to-Change-the-SSH-Port-to-Enhance-Server-Security-1200.png","type":"image\/png"}],"author":"Victor G","twitter_card":"summary_large_image","twitter_title":"How to Change the SSH Port to Enhance Server Security","twitter_description":"Learn how to change the default SSH port in Linux to reduce attacks and enhance server security. Follow our step-by-step guide.","twitter_image":"https:\/\/www.webhosting.uk.com\/kb\/wp-content\/uploads\/2025\/11\/How-to-Change-the-SSH-Port-to-Enhance-Server-Security-1200.png","twitter_creator":"@WebhostingUKcom","twitter_site":"@WebhostingUKcom","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webhosting.uk.com\/kb\/how-to-change-the-ssh-port-to-enhance-server-security\/#article","isPartOf":{"@id":"https:\/\/www.webhosting.uk.com\/kb\/how-to-change-the-ssh-port-to-enhance-server-security\/"},"author":{"name":"Victor G","@id":"https:\/\/www.webhosting.uk.com\/kb\/#\/schema\/person\/ea067684eae84c2b8b49a81c69407297"},"headline":"How to Change the SSH Port to Enhance Server Security","datePublished":"2025-11-25T08:43:17+00:00","dateModified":"2026-06-03T10:18:01+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webhosting.uk.com\/kb\/how-to-change-the-ssh-port-to-enhance-server-security\/"},"wordCount":434,"publisher":{"@id":"https:\/\/www.webhosting.uk.com\/kb\/#organization"},"keywords":["ssh"],"articleSection":["Security and Backups"],"inLanguage":"en-GB"},{"@type":"WebPage","@id":"https:\/\/www.webhosting.uk.com\/kb\/how-to-change-the-ssh-port-to-enhance-server-security\/","url":"https:\/\/www.webhosting.uk.com\/kb\/how-to-change-the-ssh-port-to-enhance-server-security\/","name":"How to Change the SSH Port for Better Linux Server Security","isPartOf":{"@id":"https:\/\/www.webhosting.uk.com\/kb\/#website"},"datePublished":"2025-11-25T08:43:17+00:00","dateModified":"2026-06-03T10:18:01+00:00","description":"Learn how to change the default SSH port in Linux to reduce attacks and enhance server security. Follow our step-by-step guide.","breadcrumb":{"@id":"https:\/\/www.webhosting.uk.com\/kb\/how-to-change-the-ssh-port-to-enhance-server-security\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webhosting.uk.com\/kb\/how-to-change-the-ssh-port-to-enhance-server-security\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.webhosting.uk.com\/kb\/how-to-change-the-ssh-port-to-enhance-server-security\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webhosting.uk.com\/kb\/"},{"@type":"ListItem","position":2,"name":"How to Change the SSH Port to Enhance Server Security"}]},{"@type":"WebSite","@id":"https:\/\/www.webhosting.uk.com\/kb\/#website","url":"https:\/\/www.webhosting.uk.com\/kb\/","name":"Webhosting UK Knowledge Base","description":"Expert Insights on Hosting, Development, Security, Marketing, and SEO","publisher":{"@id":"https:\/\/www.webhosting.uk.com\/kb\/#organization"},"alternateName":"WHUK","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webhosting.uk.com\/kb\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Organization","@id":"https:\/\/www.webhosting.uk.com\/kb\/#organization","name":"Webhosting UK","alternateName":"WHUK","url":"https:\/\/www.webhosting.uk.com\/kb\/","logo":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.webhosting.uk.com\/kb\/#\/schema\/logo\/image\/","url":"https:\/\/www.webhosting.uk.com\/kb\/wp-content\/uploads\/2023\/08\/WHUK-logo-1.png","contentUrl":"https:\/\/www.webhosting.uk.com\/kb\/wp-content\/uploads\/2023\/08\/WHUK-logo-1.png","width":1200,"height":628,"caption":"Webhosting UK"},"image":{"@id":"https:\/\/www.webhosting.uk.com\/kb\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webhostingukcom","https:\/\/x.com\/WebhostingUKcom","https:\/\/www.youtube.com\/c\/webhostinguk","https:\/\/www.linkedin.com\/company\/webhosting-uk-com-ltd\/","https:\/\/www.instagram.com\/webhosting_uk\/","https:\/\/www.tiktok.com\/@webhostinguk"],"description":"Fast, reliable, and cost-effective website hosting services with Webhosting UK. Committed to providing you secure support around the clock.","email":"sales@webhosting.uk.com","telephone":"0800 862 0890","legalName":"Webhosting UK","foundingDate":"2001-02-07","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"51","maxValue":"200"}},{"@type":"Person","@id":"https:\/\/www.webhosting.uk.com\/kb\/#\/schema\/person\/ea067684eae84c2b8b49a81c69407297","name":"Victor G","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/secure.gravatar.com\/avatar\/9bf0713adcbaded4878508c93d93927ecbfa4f74548fd9bcee41478d8768bd66?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/9bf0713adcbaded4878508c93d93927ecbfa4f74548fd9bcee41478d8768bd66?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9bf0713adcbaded4878508c93d93927ecbfa4f74548fd9bcee41478d8768bd66?s=96&d=mm&r=g","caption":"Victor G"}}]}},"_links":{"self":[{"href":"https:\/\/www.webhosting.uk.com\/kb\/wp-json\/wp\/v2\/posts\/21358","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webhosting.uk.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webhosting.uk.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webhosting.uk.com\/kb\/wp-json\/wp\/v2\/users\/28"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webhosting.uk.com\/kb\/wp-json\/wp\/v2\/comments?post=21358"}],"version-history":[{"count":9,"href":"https:\/\/www.webhosting.uk.com\/kb\/wp-json\/wp\/v2\/posts\/21358\/revisions"}],"predecessor-version":[{"id":22728,"href":"https:\/\/www.webhosting.uk.com\/kb\/wp-json\/wp\/v2\/posts\/21358\/revisions\/22728"}],"wp:attachment":[{"href":"https:\/\/www.webhosting.uk.com\/kb\/wp-json\/wp\/v2\/media?parent=21358"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webhosting.uk.com\/kb\/wp-json\/wp\/v2\/categories?post=21358"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webhosting.uk.com\/kb\/wp-json\/wp\/v2\/tags?post=21358"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}