
{"id":1594,"date":"2025-10-20T10:06:35","date_gmt":"2025-10-20T10:06:35","guid":{"rendered":"https:\/\/www.fastpanda.co.uk\/knowledge-hub\/?p=1594"},"modified":"2026-02-28T06:31:24","modified_gmt":"2026-02-28T06:31:24","slug":"how-to-change-the-ssh-port-on-centos-rhel-almalinux-rockylinux","status":"publish","type":"post","link":"https:\/\/www.fastpanda.co.uk\/knowledge-hub\/how-to-change-the-ssh-port-on-centos-rhel-almalinux-rockylinux\/","title":{"rendered":"How to Change the SSH Port on CentOS\/RHEL (AlmaLinux \/ RockyLinux)?"},"content":{"rendered":"<p data-start=\"0\" data-end=\"138\">The default SSH port can be changed by server administrators for various reasons. The main reasons for changing the port are as follows:<\/p>\n<ul>\n<li data-start=\"140\" data-end=\"434\"><strong data-start=\"140\" data-end=\"161\">Security Measure:<\/strong><br data-start=\"161\" data-end=\"164\" \/>Default SSH ports are constantly scanned by bots on the internet. This causes systems using the standard port to be frequently targeted by password-guessing attacks. To enhance security, server administrators may change the SSH port to reduce the risk of such attacks.<\/li>\n<li data-start=\"436\" data-end=\"644\"><strong data-start=\"436\" data-end=\"461\">Network Restrictions:<\/strong><br data-start=\"461\" data-end=\"464\" \/>In some organizations or networks, the use of standard ports may be blocked for security reasons. In such cases, a different port must be selected to establish an SSH connection.<\/li>\n<li data-start=\"646\" data-end=\"783\"><strong data-start=\"646\" data-end=\"676\">Preventing Port Conflicts:<\/strong><br data-start=\"676\" data-end=\"679\" \/>If another service on the server uses the same port, the SSH port may be changed to prevent conflicts.<\/li>\n<\/ul>\n<p data-start=\"785\" data-end=\"895\" data-is-last-node=\"\" data-is-only-node=\"\">For the reasons mentioned above or similar ones you can follow the steps below to safely change your SSH port.<\/p>\n<ul>\n<li data-start=\"785\" data-end=\"895\">Log in to the server. <a href=\"https:\/\/www.fastpanda.co.uk\/knowledge-hub\/how-to-connect-to-a-linux-server-from-a-windows-computer\/\" target=\"_blank\" rel=\"noopener\">If you are not familiar with the steps to access the server, click here to read our guide<\/a>. The following steps use PuTTY as an example.<\/li>\n<li data-start=\"785\" data-end=\"895\">Back up the <strong data-start=\"12\" data-end=\"27\">sshd_config<\/strong> file. Since you will be making changes to the port and security settings, any mistake could prevent you from accessing the server via SSH. Therefore, it is recommended to create a backup beforehand. To back it up, copy the command below, right-click to paste it into the server after connecting, and press Enter.<br \/>\n<b>sudo cp \/etc\/ssh\/sshd_config \/etc\/ssh\/sshd_config.bak<br \/>\n<\/b><a href=\"https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/Back-up-sshd_config.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1595\" title=\"Back up sshd_config\" src=\"https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/Back-up-sshd_config.png\" alt=\"Back up sshd config\" width=\"1914\" height=\"1003\" srcset=\"https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/Back-up-sshd_config.png 1914w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/Back-up-sshd_config-300x157.png 300w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/Back-up-sshd_config-1024x537.png 1024w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/Back-up-sshd_config-768x402.png 768w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/Back-up-sshd_config-1536x805.png 1536w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/Back-up-sshd_config-60x31.png 60w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/Back-up-sshd_config-150x79.png 150w\" sizes=\"(max-width: 1914px) 100vw, 1914px\" \/><\/a><\/li>\n<li data-start=\"785\" data-end=\"895\">To open the SSH configuration file, copy the command below, right-click to paste it into the server, and press Enter.<br \/>\n<strong>sudo nano \/etc\/ssh\/sshd_config<br \/>\n<\/strong><a href=\"https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/SSH-configuration-file.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1596\" title=\"SSH configuration file\" src=\"https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/SSH-configuration-file.png\" alt=\"SSH configuration file\" width=\"1901\" height=\"1008\" srcset=\"https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/SSH-configuration-file.png 1901w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/SSH-configuration-file-300x159.png 300w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/SSH-configuration-file-1024x543.png 1024w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/SSH-configuration-file-768x407.png 768w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/SSH-configuration-file-1536x814.png 1536w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/SSH-configuration-file-60x32.png 60w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/SSH-configuration-file-150x80.png 150w\" sizes=\"(max-width: 1901px) 100vw, 1901px\" \/><\/a><\/li>\n<li data-start=\"785\" data-end=\"895\">\n<p data-start=\"0\" data-end=\"367\">Locate the line in the file that says &#8220;Port 22&#8221; or &#8220;Port 22667&#8221;. (You may see a different port number instead of 22 or 22667.) Replace 22 or 22667 with the port number you want, for example, 6000.If there is a \u201c#\u201d at the beginning of the Port line, remove it, because # is treated as a comment and the new port may not take effect. To save, press Ctrl + O and then Enter. Immediately after, press Ctrl + X to exit.<\/p>\n<ul>\n<li data-start=\"785\" data-end=\"895\">\n<p data-start=\"0\" data-end=\"367\">Valid range: 0 &#8211; 65535<\/p>\n<\/li>\n<li data-start=\"785\" data-end=\"895\">\n<p data-start=\"0\" data-end=\"367\">0 &#8211; 1023: Reserved for the operating system and core services. Manual use is not recommended. Examples: 22 and 22667 (SSH), 80 (HTTP), 443 (HTTPS)<\/p>\n<\/li>\n<li data-start=\"785\" data-end=\"895\">\n<p data-start=\"0\" data-end=\"367\">1024 &#8211; 49151: Registered ports used by software; usually okay to use. Examples: 3306 (MySQL), 3389 (RDP)<\/p>\n<\/li>\n<li data-start=\"785\" data-end=\"895\">\n<p data-start=\"0\" data-end=\"367\">49152 &#8211; 65535: Usually free ports. This range is the safest choice for your own services.<br \/>\n<a href=\"https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/Port-22.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1597\" title=\"Port 22\" src=\"https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/Port-22.png\" alt=\"Port\" width=\"1903\" height=\"1011\" srcset=\"https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/Port-22.png 1903w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/Port-22-300x159.png 300w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/Port-22-1024x544.png 1024w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/Port-22-768x408.png 768w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/Port-22-1536x816.png 1536w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/Port-22-60x32.png 60w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/Port-22-150x80.png 150w\" sizes=\"(max-width: 1903px) 100vw, 1903px\" \/><\/a><br \/>\n<a href=\"https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/Linux-New-Port.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1598\" title=\"Linux New Port\" src=\"https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/Linux-New-Port.png\" alt=\"Linux New Port\" width=\"1906\" height=\"1011\" srcset=\"https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/Linux-New-Port.png 1906w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/Linux-New-Port-300x159.png 300w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/Linux-New-Port-1024x543.png 1024w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/Linux-New-Port-768x407.png 768w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/Linux-New-Port-1536x815.png 1536w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/Linux-New-Port-60x32.png 60w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/Linux-New-Port-150x80.png 150w\" sizes=\"(max-width: 1906px) 100vw, 1906px\" \/><\/a><\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<article class=\"text-token-text-primary w-full focus:outline-none [--shadow-height:45px] has-data-writing-block:pointer-events-none has-data-writing-block:-mt-(--shadow-height) has-data-writing-block:pt-(--shadow-height) [&amp;:has([data-writing-block])&gt;*]:pointer-events-auto scroll-mt-[calc(var(--header-height)+min(200px,max(70px,20svh)))]\" dir=\"auto\" tabindex=\"-1\" data-turn-id=\"request-WEB:5dc9e2e7-b615-451a-a05a-3da6000e5f36-8\" data-testid=\"conversation-turn-18\" data-scroll-anchor=\"true\" data-turn=\"assistant\">\n<div class=\"text-base my-auto mx-auto pb-10 [--thread-content-margin:--spacing(4)] thread-sm:[--thread-content-margin:--spacing(6)] thread-lg:[--thread-content-margin:--spacing(16)] px-(--thread-content-margin)\">\n<div class=\"[--thread-content-max-width:40rem] thread-lg:[--thread-content-max-width:48rem] mx-auto max-w-(--thread-content-max-width) flex-1 group\/turn-messages focus-visible:outline-hidden relative flex w-full min-w-0 flex-col agent-turn\" tabindex=\"-1\">\n<div class=\"flex max-w-full flex-col grow\">\n<div class=\"min-h-8 text-message relative flex w-full flex-col items-end gap-2 text-start break-words whitespace-normal [.text-message+&amp;]:mt-1\" dir=\"auto\" data-message-author-role=\"assistant\" data-message-id=\"c95313a7-449c-4e2d-8527-2e8ed3b20b8e\" data-message-model-slug=\"gpt-5-mini\">\n<div class=\"flex w-full flex-col gap-1 empty:hidden first:pt-[1px]\">\n<div class=\"markdown prose dark:prose-invert w-full break-words light markdown-new-styling\">\n<ul>\n<li data-start=\"0\" data-end=\"107\">To test the configuration, paste the command below. If no errors appear, you can proceed to the next steps.<br \/>\n<strong>sudo sshd -t &gt; Enter<br \/>\n<a href=\"https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/test-the-configuration.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1599\" title=\"test the configuration\" src=\"https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/test-the-configuration.png\" alt=\"test the configuration\" width=\"1900\" height=\"1006\" srcset=\"https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/test-the-configuration.png 1900w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/test-the-configuration-300x159.png 300w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/test-the-configuration-1024x542.png 1024w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/test-the-configuration-768x407.png 768w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/test-the-configuration-1536x813.png 1536w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/test-the-configuration-60x32.png 60w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/test-the-configuration-150x79.png 150w\" sizes=\"(max-width: 1900px) 100vw, 1900px\" \/><\/a><\/strong><\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<ul>\n<li data-start=\"0\" data-end=\"107\">Add the new port to the firewall:\n<ul>\n<li data-start=\"0\" data-end=\"107\">If Firewalld is installed, paste the following commands one by one:<br \/>\n<strong>sudo firewall-cmd &#8211;permanent &#8211;add-port=6000\/tcp &gt; Enter<\/strong><br \/>\n<strong>sudo firewall-cmd &#8211;reload &gt; Enter<\/strong><\/li>\n<li data-start=\"0\" data-end=\"107\">If Firewalld is not installed or you are using iptables, paste the following commands one by one:<br \/>\n<strong>sudo iptables -I INPUT -p tcp &#8211;dport 6000 -j ACCEPT &gt; Enter\u00a0<\/strong><br \/>\n<strong><strong>sudo service iptables save &gt; Enter<br \/>\n<\/strong><\/strong>Example of adding with iptables<br \/>\n<strong><a href=\"https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/new-port-to-the-firewall.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1600\" title=\"new port to the firewall\" src=\"https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/new-port-to-the-firewall.png\" alt=\"new port to the firewall\" width=\"1907\" height=\"1009\" srcset=\"https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/new-port-to-the-firewall.png 1907w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/new-port-to-the-firewall-300x159.png 300w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/new-port-to-the-firewall-1024x542.png 1024w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/new-port-to-the-firewall-768x406.png 768w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/new-port-to-the-firewall-1536x813.png 1536w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/new-port-to-the-firewall-60x32.png 60w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/new-port-to-the-firewall-150x79.png 150w\" sizes=\"(max-width: 1907px) 100vw, 1907px\" \/><\/a><\/strong><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<article class=\"text-token-text-primary w-full focus:outline-none [--shadow-height:45px] has-data-writing-block:pointer-events-none has-data-writing-block:-mt-(--shadow-height) has-data-writing-block:pt-(--shadow-height) [&amp;:has([data-writing-block])&gt;*]:pointer-events-auto scroll-mt-[calc(var(--header-height)+min(200px,max(70px,20svh)))]\" dir=\"auto\" tabindex=\"-1\" data-turn-id=\"request-WEB:5dc9e2e7-b615-451a-a05a-3da6000e5f36-11\" data-testid=\"conversation-turn-24\" data-scroll-anchor=\"true\" data-turn=\"assistant\">\n<div class=\"text-base my-auto mx-auto pb-10 [--thread-content-margin:--spacing(4)] thread-sm:[--thread-content-margin:--spacing(6)] thread-lg:[--thread-content-margin:--spacing(16)] px-(--thread-content-margin)\">\n<div class=\"[--thread-content-max-width:40rem] thread-lg:[--thread-content-max-width:48rem] mx-auto max-w-(--thread-content-max-width) flex-1 group\/turn-messages focus-visible:outline-hidden relative flex w-full min-w-0 flex-col agent-turn\" tabindex=\"-1\">\n<div class=\"flex max-w-full flex-col grow\">\n<div class=\"min-h-8 text-message relative flex w-full flex-col items-end gap-2 text-start break-words whitespace-normal [.text-message+&amp;]:mt-1\" dir=\"auto\" data-message-author-role=\"assistant\" data-message-id=\"e504f99c-dce5-4e9f-a124-7179382a564d\" data-message-model-slug=\"gpt-5-mini\">\n<div class=\"flex w-full flex-col gap-1 empty:hidden first:pt-[1px]\">\n<ul>\n<li data-start=\"0\" data-end=\"31\">To restart the SSH service, paste the following command.<br \/>\n<strong>sudo systemctl restart sshd &gt; Enter\u00a0<\/strong><br \/>\n<a href=\"https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/restart-the-SSH-service.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1601\" title=\"restart the SSH service\" src=\"https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/restart-the-SSH-service.png\" alt=\"restart the SSH service\" width=\"1902\" height=\"1002\" srcset=\"https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/restart-the-SSH-service.png 1902w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/restart-the-SSH-service-300x158.png 300w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/restart-the-SSH-service-1024x539.png 1024w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/restart-the-SSH-service-768x405.png 768w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/restart-the-SSH-service-1536x809.png 1536w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/restart-the-SSH-service-60x32.png 60w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/restart-the-SSH-service-150x79.png 150w\" sizes=\"(max-width: 1902px) 100vw, 1902px\" \/><\/a><\/li>\n<li data-start=\"0\" data-end=\"31\">To test access, do not close your current PuTTY session. Open a new PuTTY window, enter your new port number (e.g., 6000) in the &#8220;Port&#8221; field, and try to connect. If the connection is successful, SSH is now running on the new port.<br \/>\n<a href=\"https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/Putty-Port.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1602\" title=\"Putty Port\" src=\"https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/Putty-Port.png\" alt=\"Putty Port\" width=\"1919\" height=\"875\" srcset=\"https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/Putty-Port.png 1919w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/Putty-Port-300x137.png 300w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/Putty-Port-1024x467.png 1024w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/Putty-Port-768x350.png 768w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/Putty-Port-1536x700.png 1536w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/Putty-Port-60x27.png 60w, https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-content\/uploads\/2025\/10\/Putty-Port-150x68.png 150w\" sizes=\"(max-width: 1919px) 100vw, 1919px\" \/><\/a><\/li>\n<li data-start=\"0\" data-end=\"31\">If you wish, you can remove the old port from the firewall. To do this, paste the following commands one by one.\n<ul>\n<li data-start=\"0\" data-end=\"31\">If Firewalld is installed, paste the following commands one by one:<br \/>\n<strong>sudo firewall-cmd &#8211;permanent &#8211;remove-port=22\/tcp<\/strong> (You can replace 22 with your own old port number.) &gt; <strong>Enter<br \/>\n<\/strong>or <strong>sudo firewall-cmd &#8211;permanent &#8211;remove-port=22667\/tcp <\/strong>(You can replace 22667 with your own old port number.)<strong> &gt; Enter<br \/>\n<\/strong><br \/>\n<strong>sudo firewall-cmd &#8211;reload &gt; Enter\u00a0<\/strong><\/li>\n<li data-start=\"0\" data-end=\"31\">If Firewalld is not installed or you are using iptables, paste the following commands one by one:<br \/>\n<strong>sudo iptables -D INPUT -p tcp &#8211;dport 6000 -j ACCEPT<\/strong> (Replace 1234 with your chosen new port number.) &gt; <strong>Enter\u00a0<\/strong><br \/>\n<strong>sudo service iptables save &gt; Enter\u00a0<\/strong><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/article>\n<\/div>\n<\/div>\n<\/div>\n<\/article>\n","protected":false},"excerpt":{"rendered":"<p>The default SSH port can be changed by server administrators for various reasons. The main reasons for changing the port are as follows: Security Measure:Default SSH ports are constantly scanned by bots on the internet. This causes systems using the standard port to be frequently targeted by password-guessing attacks. To enhance security, server administrators may [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"_links":{"self":[{"href":"https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-json\/wp\/v2\/posts\/1594"}],"collection":[{"href":"https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-json\/wp\/v2\/comments?post=1594"}],"version-history":[{"count":12,"href":"https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-json\/wp\/v2\/posts\/1594\/revisions"}],"predecessor-version":[{"id":1620,"href":"https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-json\/wp\/v2\/posts\/1594\/revisions\/1620"}],"wp:attachment":[{"href":"https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-json\/wp\/v2\/media?parent=1594"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-json\/wp\/v2\/categories?post=1594"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fastpanda.co.uk\/knowledge-hub\/wp-json\/wp\/v2\/tags?post=1594"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}