{"id":3429,"date":"2024-07-11T10:00:28","date_gmt":"2024-07-11T10:00:28","guid":{"rendered":"https:\/\/draculaservers.com\/tutorials\/?p=3429"},"modified":"2024-08-04T21:18:47","modified_gmt":"2024-08-04T21:18:47","slug":"run-the-ssh-server-on-a-port-other-than-22-ubuntu-guide","status":"publish","type":"post","link":"https:\/\/draculaservers.com\/tutorials\/run-the-ssh-server-on-a-port-other-than-22-ubuntu-guide\/","title":{"rendered":"Run the SSH Server on a Port Other Than 22 &#8211; Ubuntu Guide"},"content":{"rendered":"<div class=\"cl-preview-section\">\n<p>SSH (Secure Shell) is a network protocol that allows secure remote login and other network services over an unsecured network. It provides a secure channel over an otherwise insecure network by using encryption. The default port for SSH is port 22. This port is universally recognized and is the standard for SSH communications.<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>Changing the default SSH port can be a useful measure for improving security. Port 22 is well-known and frequently targeted by automated attacks and brute-force attempts. By selecting a less common port number, you can reduce the number of automated attacks and potential unauthorized access attempts, adding an additional layer of obscurity to your system.<\/p>\n\n<\/div>\n<div class=\"cl-preview-section\">\n<p>This guide will demonstrate how you can easily change the default SSH port to a port other than 22.<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<h2 id=\"benefits-of-changing-the-ssh-port\">Benefits of Changing the SSH Port<\/h2>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>While changing the SSH port alone does not provide robust security, it can act as a deterrent against automated attacks. Using a non-standard port makes it less likely that automated scripts and bots will target your server, as they often scan for default ports like 22.<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>Automated scanning tools typically look for services running on standard ports. By moving SSH to a different port, you can minimize the number of these automated attacks. This doesn\u2019t replace the need for strong passwords and key-based authentication but can reduce the volume of attack attempts your server receives.<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<h3 id=\"step-1-install-ssh-server-if-not-already-installed\">Step 1: Install SSH Server (If Not Already Installed)<\/h3>\n<\/div>\n<div class=\"cl-preview-section\">\n<p><strong>Check for SSH Installation<\/strong><\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>To verify if the SSH server is already installed on your Ubuntu system, you can use the following command to check the status of the SSH service:<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<pre class=\" language-bash\"><code class=\"prism language-bash\"><span class=\"token function\">sudo<\/span> systemctl status <span class=\"token function\">ssh<\/span>\r\n<\/code><\/pre>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>If the SSH server is installed, you will see an output indicating that the service is active (running) or inactive. If the service is not found, it means that SSH is not installed.<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<p><strong>Install OpenSSH Server<\/strong><\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>If SSH is not installed, you can easily install it using the package manager. Run the following commands to update your package list and install the OpenSSH server:<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<pre class=\" language-bash\"><code class=\"prism language-bash\"><span class=\"token function\">sudo<\/span> apt update <span class=\"token operator\">&amp;&amp;<\/span> <span class=\"token function\">sudo<\/span> apt <span class=\"token function\">install<\/span> openssh-server\r\n<\/code><\/pre>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>This command will first update your package repository to ensure you have the latest package information, and then it will install the\u00a0<code>openssh-server<\/code> package, which includes the SSH server.<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<h3 id=\"step-2-choose-a-new-port-number\">Step 2: Choose a New Port Number<\/h3>\n<\/div>\n<div class=\"cl-preview-section\">\n<p><strong>Selecting an Alternative Port<\/strong><\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>When selecting a new port number for your SSH server, consider choosing a port within the range of 1024 to 49151. This range is reserved for user-defined applications and is less likely to conflict with well-known ports used by other services.<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<p><strong>Recommendations:<\/strong><\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<ol>\n<li><strong>Choose a Port Between 1024 and 49151:<\/strong>\u00a0Avoid using ports below 1024, as these are known as well-known ports and are commonly used by other system services.<\/li>\n<li><strong>Avoid Ports in Use by Other Services:<\/strong>\u00a0Ensure that the port you select is not already in use by other services on your system. You can check for open ports using the\u00a0<code>netstat<\/code>\u00a0or\u00a0<code>ss<\/code>\u00a0command:\n<pre class=\" language-bash\"><code class=\"prism language-bash\"><span class=\"token function\">sudo<\/span> <span class=\"token function\">netstat<\/span> -tuln\r\n<\/code><\/pre>\n<p>or<\/p>\n<pre class=\" language-bash\"><code class=\"prism language-bash\"><span class=\"token function\">sudo<\/span> ss -tuln\r\n<\/code><\/pre>\n<p>Look through the list to ensure the port you choose is not listed as being in use.<\/li>\n<\/ol>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>By following these steps, you will ensure that your SSH server runs on a non-standard port, helping to enhance security and reduce the likelihood of automated attacks.<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<h3 id=\"step-3-configure-ssh-to-use-the-new-port\">Step 3: Configure SSH to Use the New Port<\/h3>\n<\/div>\n<div class=\"cl-preview-section\">\n<p><strong>Edit the SSH Configuration File<\/strong><\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>To change the SSH port, you need to edit the SSH server configuration file, which is typically located at\u00a0<code>\/etc\/ssh\/sshd_config<\/code>. Open this file in your preferred text editor. Here, we use\u00a0<code>nano<\/code>\u00a0for simplicity:<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<pre class=\" language-bash\"><code class=\"prism language-bash\"><span class=\"token function\">sudo<\/span> <span class=\"token function\">nano<\/span> \/etc\/ssh\/sshd_config\r\n<\/code><\/pre>\n<\/div>\n<div class=\"cl-preview-section\">\n<p><strong>Modify the Port Setting<\/strong><\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>In the configuration file, look for the line that specifies the port number. It will look like this:<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<pre class=\" language-plaintext\"><code class=\"prism language-plaintext\">#Port 22\r\n<\/code><\/pre>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>Uncomment this line by removing the\u00a0<code>#<\/code>\u00a0at the beginning, and change\u00a0<code>22<\/code>\u00a0to your desired port number. For example, to use port\u00a0<code>2222<\/code>, modify the line as follows:<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<pre class=\" language-plaintext\"><code class=\"prism language-plaintext\">Port 2222\r\n<\/code><\/pre>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>Save the file and exit the text editor. In\u00a0<code>nano<\/code>, you can do this by pressing\u00a0<code>Ctrl+X<\/code>, then\u00a0<code>Y<\/code>\u00a0to confirm the changes, and\u00a0<code>Enter<\/code>\u00a0to save.<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<h3 id=\"step-4-adjust-firewall-settings\">Step 4: Adjust Firewall Settings<\/h3>\n<\/div>\n<div class=\"cl-preview-section\">\n<p><strong>Allow the New SSH Port Through the Firewall<\/strong><\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>If you have a firewall enabled on your Ubuntu system, you need to configure it to allow traffic on the new SSH port. Ubuntu uses\u00a0<code>ufw<\/code>\u00a0(Uncomplicated Firewall) by default, which makes it easy to manage firewall rules.<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>To allow traffic on the new SSH port, use the following command, replacing\u00a0<code>2222<\/code>\u00a0with the port number you chose:<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<pre class=\" language-bash\"><code class=\"prism language-bash\"><span class=\"token function\">sudo<\/span> ufw allow 2222\/tcp\r\n<\/code><\/pre>\n<\/div>\n<div class=\"cl-preview-section\">\n<p><strong>Verify the Firewall Rule<\/strong><\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>To ensure that the new rule has been added correctly, you can list the current firewall rules with the following command:<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<pre class=\" language-bash\"><code class=\"prism language-bash\"><span class=\"token function\">sudo<\/span> ufw status\r\n<\/code><\/pre>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>This command will display a list of allowed services and ports, including your newly added SSH port. Ensure that you see an entry similar to:<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<pre class=\" language-plaintext\"><code class=\"prism language-plaintext\">2222\/tcp                   ALLOW       Anywhere\r\n2222\/tcp (v6)              ALLOW       Anywhere (v6)\r\n<\/code><\/pre>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>With these steps, you\u2019ve successfully configured your firewall to allow SSH connections on your chosen port, enhancing the security of your SSH service.<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<h3 id=\"step-5-restart-the-ssh-service\">Step 5: Restart the SSH Service<\/h3>\n<\/div>\n<div class=\"cl-preview-section\">\n<p><strong>Restart SSH to Apply Changes<\/strong><\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>After updating the configuration file and adjusting the firewall, you need to restart the SSH service to apply the changes. Use the following command to restart the SSH daemon:<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<pre class=\" language-bash\"><code class=\"prism language-bash\"><span class=\"token function\">sudo<\/span> systemctl restart <span class=\"token function\">ssh<\/span>\r\n<\/code><\/pre>\n<\/div>\n<div class=\"cl-preview-section\">\n<p><strong>Verify SSH Service Status<\/strong><\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>Ensure that the SSH service is running correctly after the restart by checking its status:<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<pre class=\" language-bash\"><code class=\"prism language-bash\"><span class=\"token function\">sudo<\/span> systemctl status <span class=\"token function\">ssh<\/span>\r\n<\/code><\/pre>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>You should see an output indicating that the SSH service is active and running. If there are any errors, they will be displayed here, which can help in troubleshooting.<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<h3 id=\"step-6-update-ssh-client-configuration\">Step 6: Update SSH Client Configuration<\/h3>\n<\/div>\n<div class=\"cl-preview-section\">\n<p><strong>Connect to the SSH Server on the New Port<\/strong><\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>Now that the SSH server is configured to listen on the new port, you need to specify this port when connecting from an SSH client. You can do this by using the\u00a0<code>-p<\/code>\u00a0option followed by the port number. For example, if your new port is\u00a0<code>2222<\/code>, use the following command:<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<pre class=\" language-bash\"><code class=\"prism language-bash\"><span class=\"token function\">ssh<\/span> -p 2222 username@hostname\r\n<\/code><\/pre>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>Replace\u00a0<code>username<\/code>\u00a0with your SSH username and\u00a0<code>hostname<\/code>\u00a0with the IP address or domain name of your SSH server.<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<p><strong>Update SSH Client Configuration (Optional)<\/strong><\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>For convenience, you can add the new port configuration to your SSH client settings, so you don\u2019t have to specify the port number each time you connect. Edit the\u00a0<code>~\/.ssh\/config<\/code>\u00a0file (create it if it doesn\u2019t exist) and add an entry like this:<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<pre class=\" language-plaintext\"><code class=\"prism language-plaintext\">Host myserver\r\n    HostName hostname\r\n    User username\r\n    Port 2222\r\n<\/code><\/pre>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>Replace\u00a0<code>myserver<\/code>\u00a0with a name you want to use for this connection,\u00a0<code>hostname<\/code>\u00a0with your server\u2019s address,\u00a0<code>username<\/code>\u00a0with your SSH username, and\u00a0<code>2222<\/code>\u00a0with your new SSH port. Save the file and you can now connect using a simplified command:<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<pre class=\" language-bash\"><code class=\"prism language-bash\"><span class=\"token function\">ssh<\/span> myserver\r\n<\/code><\/pre>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>With these steps, you\u2019ve successfully configured your SSH client to connect to your server on the new port, making your remote management process more secure and streamlined.<\/p>\n<div class=\"cl-preview-section\">\n<h2 id=\"affordable-vps-hosting-with-dracula-servers\"><span style=\"color: #ff2600;\">Affordable VPS Hosting With Dracula Servers<\/span><\/h2>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>Looking for reliable and budget-friendly Virtual Private Server (VPS) hosting? Look no further than\u00a0<a href=\"https:\/\/draculaservers.com\/\">Dracula Servers<\/a>. Dracula Servers offers a range of VPS hosting plans tailored to meet diverse needs. With competitive pricing, robust performance, and a user-friendly interface, it\u2019s an excellent choice for individuals and businesses alike.<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>Explore the\u00a0<a href=\"https:\/\/draculaservers.com\/\">Dracula Servers website<\/a> to discover hosting solutions that align with your requirements and take your online presence to new heights with their affordable and efficient VPS hosting services.<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<p><a href=\"https:\/\/draculaservers.com\/\"><strong>Visit Dracula Servers<\/strong><\/a>\u00a0and experience reliable VPS hosting without breaking the bank.<\/p>\n<\/div>\n<\/div>\n<div class=\"cl-preview-section\">\n<h3 id=\"troubleshooting\">Troubleshooting<\/h3>\n<\/div>\n<div class=\"cl-preview-section\">\n<p><strong>Common Issues and Solutions<\/strong><\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>When changing the SSH port, you may encounter several common issues. Here are some potential problems and solutions:<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<ol>\n<li><strong>SSH Connection Failures<\/strong>\n<ul>\n<li><strong>Symptom:<\/strong>\u00a0Unable to connect to the SSH server on the new port.<\/li>\n<li><strong>Solution:<\/strong>\u00a0Ensure that the SSH service is running and listening on the new port. Use the following command to check the status:\n<pre class=\" language-bash\"><code class=\"prism language-bash\"><span class=\"token function\">sudo<\/span> systemctl status <span class=\"token function\">ssh<\/span>\r\n<\/code><\/pre>\n<p>Verify that the new port is listed and active. If not, double-check the\u00a0<code>\/etc\/ssh\/sshd_config<\/code>\u00a0file for typos or incorrect configurations.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Firewall Misconfigurations<\/strong>\n<ul>\n<li><strong>Symptom:<\/strong>\u00a0The SSH connection is blocked or not reaching the server.<\/li>\n<li><strong>Solution:<\/strong>\u00a0Ensure that the firewall is configured to allow traffic on the new SSH port. Check the firewall status with:\n<pre class=\" language-bash\"><code class=\"prism language-bash\"><span class=\"token function\">sudo<\/span> ufw status\r\n<\/code><\/pre>\n<p>If the new port is not listed, add it using:<\/p>\n<pre class=\" language-bash\"><code class=\"prism language-bash\"><span class=\"token function\">sudo<\/span> ufw allow <span class=\"token punctuation\">[<\/span>new_port_number<span class=\"token punctuation\">]<\/span>\/tcp\r\n<\/code><\/pre>\n<p>Replace\u00a0<code>[new_port_number]<\/code>\u00a0with your chosen port.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<\/div>\n<div class=\"cl-preview-section\">\n<p><strong>Reverting to the Default Port<\/strong><\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>If you need to revert to the default SSH port (22), follow these steps:<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<ol>\n<li><strong>Edit the SSH Configuration File<\/strong>\n<ul>\n<li>Open the SSH configuration file in a text editor:\n<pre class=\" language-bash\"><code class=\"prism language-bash\"><span class=\"token function\">sudo<\/span> <span class=\"token function\">nano<\/span> \/etc\/ssh\/sshd_config\r\n<\/code><\/pre>\n<\/li>\n<li>Find the line that specifies the new port (e.g.,\u00a0<code>Port 2222<\/code>) and change it back to\u00a0<code>Port 22<\/code>.<\/li>\n<\/ul>\n<\/li>\n<li><strong>Restart the SSH Service<\/strong>\n<ul>\n<li>Apply the changes by restarting the SSH service:\n<pre class=\" language-bash\"><code class=\"prism language-bash\"><span class=\"token function\">sudo<\/span> systemctl restart <span class=\"token function\">ssh<\/span>\r\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<li><strong>Update Firewall Rules<\/strong>\n<ul>\n<li>If you modified firewall rules to allow the new port, revert those changes:\n<pre class=\" language-bash\"><code class=\"prism language-bash\"><span class=\"token function\">sudo<\/span> ufw delete allow <span class=\"token punctuation\">[<\/span>new_port_number<span class=\"token punctuation\">]<\/span>\/tcp\r\n<span class=\"token function\">sudo<\/span> ufw allow 22\/tcp\r\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>By following these steps, you can revert your SSH configuration back to its default settings.<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<h3 id=\"conclusion\">Conclusion<\/h3>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>In this guide, we covered how to change the SSH server port on an Ubuntu system. We began by verifying the SSH installation and choosing a new port number, then edited the SSH configuration file and updated the firewall rules. Finally, we restarted the SSH service and updated our SSH client configuration.<\/p>\n<\/div>\n<div class=\"cl-preview-section\">\n<p>Changing the default SSH port is a simple yet effective way to enhance security through obscurity. However, it\u2019s essential to follow other best practices as well. Regularly update your system, use strong passwords or SSH keys, and stay informed about the latest security measures to keep your server secure. Experiment with different configurations to find what best suits your needs while ensuring your system remains protected.<\/p>\n<p>Check out More Linux Tutorials <a href=\"https:\/\/draculaservers.com\/tutorials\/\" target=\"_blank\" rel=\"noopener\">Here!<\/a><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>SSH (Secure Shell) is a network protocol that allows secure remote login and other network services over an unsecured network. It provides a secure channel over an otherwise insecure network by using encryption. The default port for SSH is port 22. This port is universally recognized and is the standard for SSH communications. Changing the [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":3430,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22],"tags":[],"class_list":["post-3429","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ubuntu"],"blocksy_meta":[],"featured_image_urls_v2":{"full":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2024\/08\/Dracula-Servers-Thumbnail-30.png",1280,720,false],"thumbnail":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2024\/08\/Dracula-Servers-Thumbnail-30-150x150.png",150,150,true],"medium":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2024\/08\/Dracula-Servers-Thumbnail-30-300x169.png",300,169,true],"medium_large":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2024\/08\/Dracula-Servers-Thumbnail-30-768x432.png",768,432,true],"large":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2024\/08\/Dracula-Servers-Thumbnail-30-1024x576.png",1024,576,true],"1536x1536":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2024\/08\/Dracula-Servers-Thumbnail-30.png",1280,720,false],"2048x2048":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2024\/08\/Dracula-Servers-Thumbnail-30.png",1280,720,false],"pk-small":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2024\/08\/Dracula-Servers-Thumbnail-30-80x80.png",80,80,true],"pk-thumbnail":["https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2024\/08\/Dracula-Servers-Thumbnail-30-300x225.png",300,225,true]},"post_excerpt_stackable_v2":"<p>SSH (Secure Shell) is a network protocol that allows secure remote login and other network services over an unsecured network. It provides a secure channel over an otherwise insecure network by using encryption. The default port for SSH is port 22. This port is universally recognized and is the standard for SSH communications. Changing the default SSH port can be a useful measure for improving security. Port 22 is well-known and frequently targeted by automated attacks and brute-force attempts. By selecting a less common port number, you can reduce the number of automated attacks and potential unauthorized access attempts, adding&hellip;<\/p>\n","category_list_v2":"<a href=\"https:\/\/draculaservers.com\/tutorials\/category\/ubuntu\/\" rel=\"category tag\">Ubuntu<\/a>","author_info_v2":{"name":"Abdul Mannan","url":"https:\/\/draculaservers.com\/tutorials\/author\/abdul-mannan-tbgmail-com\/"},"comments_num_v2":"0 comments","yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Run the SSH Server on a Port Other Than 22 - Ubuntu Guide - Dracula Servers Tutorials<\/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:\/\/draculaservers.com\/tutorials\/run-the-ssh-server-on-a-port-other-than-22-ubuntu-guide\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Run the SSH Server on a Port Other Than 22 - Ubuntu Guide - Dracula Servers Tutorials\" \/>\n<meta property=\"og:description\" content=\"SSH (Secure Shell) is a network protocol that allows secure remote login and other network services over an unsecured network. It provides a secure channel over an otherwise insecure network by using encryption. The default port for SSH is port 22. This port is universally recognized and is the standard for SSH communications. Changing the [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/draculaservers.com\/tutorials\/run-the-ssh-server-on-a-port-other-than-22-ubuntu-guide\/\" \/>\n<meta property=\"og:site_name\" content=\"Dracula Servers Tutorials\" \/>\n<meta property=\"article:published_time\" content=\"2024-07-11T10:00:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-08-04T21:18:47+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2024\/08\/Dracula-Servers-Thumbnail-30.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Abdul Mannan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Abdul Mannan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/run-the-ssh-server-on-a-port-other-than-22-ubuntu-guide\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/run-the-ssh-server-on-a-port-other-than-22-ubuntu-guide\\\/\"},\"author\":{\"name\":\"Abdul Mannan\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/ac89d0281f4fb596bfaa0bc1e746c8a6\"},\"headline\":\"Run the SSH Server on a Port Other Than 22 &#8211; Ubuntu Guide\",\"datePublished\":\"2024-07-11T10:00:28+00:00\",\"dateModified\":\"2024-08-04T21:18:47+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/run-the-ssh-server-on-a-port-other-than-22-ubuntu-guide\\\/\"},\"wordCount\":1510,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/run-the-ssh-server-on-a-port-other-than-22-ubuntu-guide\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2024\\\/08\\\/Dracula-Servers-Thumbnail-30.png\",\"articleSection\":[\"Ubuntu\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/run-the-ssh-server-on-a-port-other-than-22-ubuntu-guide\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/run-the-ssh-server-on-a-port-other-than-22-ubuntu-guide\\\/\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/run-the-ssh-server-on-a-port-other-than-22-ubuntu-guide\\\/\",\"name\":\"Run the SSH Server on a Port Other Than 22 - Ubuntu Guide - Dracula Servers Tutorials\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/run-the-ssh-server-on-a-port-other-than-22-ubuntu-guide\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/run-the-ssh-server-on-a-port-other-than-22-ubuntu-guide\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2024\\\/08\\\/Dracula-Servers-Thumbnail-30.png\",\"datePublished\":\"2024-07-11T10:00:28+00:00\",\"dateModified\":\"2024-08-04T21:18:47+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/run-the-ssh-server-on-a-port-other-than-22-ubuntu-guide\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/run-the-ssh-server-on-a-port-other-than-22-ubuntu-guide\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/run-the-ssh-server-on-a-port-other-than-22-ubuntu-guide\\\/#primaryimage\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2024\\\/08\\\/Dracula-Servers-Thumbnail-30.png\",\"contentUrl\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2024\\\/08\\\/Dracula-Servers-Thumbnail-30.png\",\"width\":1280,\"height\":720,\"caption\":\"Run the SSH Server on a Port Other Than 22 - Ubuntu Guide\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/run-the-ssh-server-on-a-port-other-than-22-ubuntu-guide\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Run the SSH Server on a Port Other Than 22 &#8211; Ubuntu Guide\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#website\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/\",\"name\":\"Dracula Servers Tutorials\",\"description\":\"Dedicated Servers\",\"publisher\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#organization\",\"name\":\"Dracula Servers\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2016\\\/06\\\/dracula_full_logo_smaller.png\",\"contentUrl\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/wp-content\\\/uploads\\\/2016\\\/06\\\/dracula_full_logo_smaller.png\",\"width\":1625,\"height\":200,\"caption\":\"Dracula Servers\"},\"image\":{\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/draculaservers.com\\\/tutorials\\\/#\\\/schema\\\/person\\\/ac89d0281f4fb596bfaa0bc1e746c8a6\",\"name\":\"Abdul Mannan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2809442d44177cab4f90e1d9b3295560462063881ca1374b6d597d8f0b48fc21?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2809442d44177cab4f90e1d9b3295560462063881ca1374b6d597d8f0b48fc21?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2809442d44177cab4f90e1d9b3295560462063881ca1374b6d597d8f0b48fc21?s=96&d=mm&r=g\",\"caption\":\"Abdul Mannan\"},\"description\":\"An individual trying to decipher the enigmas of technology by the sheer driving force of curiosity. Interested in learning new skills and being better at those skills than the lot.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Run the SSH Server on a Port Other Than 22 - Ubuntu Guide - Dracula Servers Tutorials","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:\/\/draculaservers.com\/tutorials\/run-the-ssh-server-on-a-port-other-than-22-ubuntu-guide\/","og_locale":"en_US","og_type":"article","og_title":"Run the SSH Server on a Port Other Than 22 - Ubuntu Guide - Dracula Servers Tutorials","og_description":"SSH (Secure Shell) is a network protocol that allows secure remote login and other network services over an unsecured network. It provides a secure channel over an otherwise insecure network by using encryption. The default port for SSH is port 22. This port is universally recognized and is the standard for SSH communications. Changing the [&hellip;]","og_url":"https:\/\/draculaservers.com\/tutorials\/run-the-ssh-server-on-a-port-other-than-22-ubuntu-guide\/","og_site_name":"Dracula Servers Tutorials","article_published_time":"2024-07-11T10:00:28+00:00","article_modified_time":"2024-08-04T21:18:47+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2024\/08\/Dracula-Servers-Thumbnail-30.png","type":"image\/png"}],"author":"Abdul Mannan","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Abdul Mannan","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/draculaservers.com\/tutorials\/run-the-ssh-server-on-a-port-other-than-22-ubuntu-guide\/#article","isPartOf":{"@id":"https:\/\/draculaservers.com\/tutorials\/run-the-ssh-server-on-a-port-other-than-22-ubuntu-guide\/"},"author":{"name":"Abdul Mannan","@id":"https:\/\/draculaservers.com\/tutorials\/#\/schema\/person\/ac89d0281f4fb596bfaa0bc1e746c8a6"},"headline":"Run the SSH Server on a Port Other Than 22 &#8211; Ubuntu Guide","datePublished":"2024-07-11T10:00:28+00:00","dateModified":"2024-08-04T21:18:47+00:00","mainEntityOfPage":{"@id":"https:\/\/draculaservers.com\/tutorials\/run-the-ssh-server-on-a-port-other-than-22-ubuntu-guide\/"},"wordCount":1510,"commentCount":0,"publisher":{"@id":"https:\/\/draculaservers.com\/tutorials\/#organization"},"image":{"@id":"https:\/\/draculaservers.com\/tutorials\/run-the-ssh-server-on-a-port-other-than-22-ubuntu-guide\/#primaryimage"},"thumbnailUrl":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2024\/08\/Dracula-Servers-Thumbnail-30.png","articleSection":["Ubuntu"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/draculaservers.com\/tutorials\/run-the-ssh-server-on-a-port-other-than-22-ubuntu-guide\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/draculaservers.com\/tutorials\/run-the-ssh-server-on-a-port-other-than-22-ubuntu-guide\/","url":"https:\/\/draculaservers.com\/tutorials\/run-the-ssh-server-on-a-port-other-than-22-ubuntu-guide\/","name":"Run the SSH Server on a Port Other Than 22 - Ubuntu Guide - Dracula Servers Tutorials","isPartOf":{"@id":"https:\/\/draculaservers.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/draculaservers.com\/tutorials\/run-the-ssh-server-on-a-port-other-than-22-ubuntu-guide\/#primaryimage"},"image":{"@id":"https:\/\/draculaservers.com\/tutorials\/run-the-ssh-server-on-a-port-other-than-22-ubuntu-guide\/#primaryimage"},"thumbnailUrl":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2024\/08\/Dracula-Servers-Thumbnail-30.png","datePublished":"2024-07-11T10:00:28+00:00","dateModified":"2024-08-04T21:18:47+00:00","breadcrumb":{"@id":"https:\/\/draculaservers.com\/tutorials\/run-the-ssh-server-on-a-port-other-than-22-ubuntu-guide\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/draculaservers.com\/tutorials\/run-the-ssh-server-on-a-port-other-than-22-ubuntu-guide\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/draculaservers.com\/tutorials\/run-the-ssh-server-on-a-port-other-than-22-ubuntu-guide\/#primaryimage","url":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2024\/08\/Dracula-Servers-Thumbnail-30.png","contentUrl":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2024\/08\/Dracula-Servers-Thumbnail-30.png","width":1280,"height":720,"caption":"Run the SSH Server on a Port Other Than 22 - Ubuntu Guide"},{"@type":"BreadcrumbList","@id":"https:\/\/draculaservers.com\/tutorials\/run-the-ssh-server-on-a-port-other-than-22-ubuntu-guide\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/draculaservers.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Run the SSH Server on a Port Other Than 22 &#8211; Ubuntu Guide"}]},{"@type":"WebSite","@id":"https:\/\/draculaservers.com\/tutorials\/#website","url":"https:\/\/draculaservers.com\/tutorials\/","name":"Dracula Servers Tutorials","description":"Dedicated Servers","publisher":{"@id":"https:\/\/draculaservers.com\/tutorials\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/draculaservers.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/draculaservers.com\/tutorials\/#organization","name":"Dracula Servers","url":"https:\/\/draculaservers.com\/tutorials\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/draculaservers.com\/tutorials\/#\/schema\/logo\/image\/","url":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2016\/06\/dracula_full_logo_smaller.png","contentUrl":"https:\/\/draculaservers.com\/tutorials\/wp-content\/uploads\/2016\/06\/dracula_full_logo_smaller.png","width":1625,"height":200,"caption":"Dracula Servers"},"image":{"@id":"https:\/\/draculaservers.com\/tutorials\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/draculaservers.com\/tutorials\/#\/schema\/person\/ac89d0281f4fb596bfaa0bc1e746c8a6","name":"Abdul Mannan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/2809442d44177cab4f90e1d9b3295560462063881ca1374b6d597d8f0b48fc21?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/2809442d44177cab4f90e1d9b3295560462063881ca1374b6d597d8f0b48fc21?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2809442d44177cab4f90e1d9b3295560462063881ca1374b6d597d8f0b48fc21?s=96&d=mm&r=g","caption":"Abdul Mannan"},"description":"An individual trying to decipher the enigmas of technology by the sheer driving force of curiosity. Interested in learning new skills and being better at those skills than the lot."}]}},"_links":{"self":[{"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/posts\/3429","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/comments?post=3429"}],"version-history":[{"count":1,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/posts\/3429\/revisions"}],"predecessor-version":[{"id":3431,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/posts\/3429\/revisions\/3431"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/media\/3430"}],"wp:attachment":[{"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/media?parent=3429"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/categories?post=3429"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/draculaservers.com\/tutorials\/wp-json\/wp\/v2\/tags?post=3429"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}