{"id":2225,"date":"2023-01-18T21:44:05","date_gmt":"2023-01-18T21:44:05","guid":{"rendered":"https:\/\/tryrdp.com\/blog\/?p=2225"},"modified":"2026-05-24T06:27:07","modified_gmt":"2026-05-24T06:27:07","slug":"change-the-ssh-port-in-linux","status":"publish","type":"post","link":"https:\/\/tryrdp.com\/blog\/change-the-ssh-port-in-linux\/","title":{"rendered":"How to Change the SSH Port in Linux"},"content":{"rendered":"<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/tryrdp.com\/blog\/wp-content\/uploads\/2022\/12\/image-44.png\" alt=\"\" class=\"wp-image-2227\" width=\"1128\" height=\"564\" srcset=\"https:\/\/tryrdp.com\/blog\/wp-content\/uploads\/2022\/12\/image-44.png 700w, https:\/\/tryrdp.com\/blog\/wp-content\/uploads\/2022\/12\/image-44-300x150.png 300w\" sizes=\"auto, (max-width: 1128px) 100vw, 1128px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">SSH (Secure Shell or Secure Socket Shell) is an open encrypted network protocol. It provides a safe way for users to access a computer to communicate and share data over an unsecured network. SSH uses a client-server model to provide encrypted data communications, strong password authentication, and public key authentication.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Network administrators frequently use SSH to manage systems and applications. SSH also helps network administrators by allowing them to execute commands, move files, and log in to another computer over a network. It is mainly used to perform operations on a remote computer by login.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">SSH is utilized for port forwarding, tunneling, and the execution of Linux server commands. It is significant to set up SSH in Linux. Before changing the SSH port in Linux, it is essential to know the components of SSH command, various SSH commands, SSH command-line options, and SSH working.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Components of SSH Command<\/strong><\/h2>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.jamesridgway.co.uk\/content\/images\/2020\/03\/ssh-config.png\" alt=\"Simplify SSH with SSH Config Files - James Ridgway\" width=\"1341\" height=\"550\"\/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">SSH command has three components. They are the following.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&nbsp;\u2022 SSH command<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;SSH command tells the machine to make an encrypted, safe connection to the host system.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&nbsp;\u2022 Username<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;The name of a Linux user whose information is accessed by the host machine is the user name.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&nbsp;\u2022 Host<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;IP address, domain name, and the user&#8217;s machine, such as a router or computer, are known as the host.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>SSH Commands<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">An unsecured network-to-host encrypted connection is made possible by the ssh command. There are many SSH commands. They are the following.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&nbsp;\u2022 ssh-keygen<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;ssh-keygen is used to create a key pair for public key authentication and connection establishment.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&nbsp;\u2022 ssh-add<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;ssh-add is used to add a key to the agent.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&nbsp;\u2022 ssh-copy-id<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">On a server, ssh-copy-id is used to set a public key up as a legitimate user.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&nbsp;\u2022 ssh-agent<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For single sign-on, ssh-agent is used to create an agent that holds the private key.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&nbsp;\u2022 sshd<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;sshd is a Linux-based OpenSSH server.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&nbsp;\u2022 sftp<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">sfp is a file transfer client. This SSH command provides an FTP-like command-line interface.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&nbsp;\u2022 scp<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Scp is a file transfer client. This SSH command provides an RCP-like command-line interface.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>SSH command-line options<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Port forwarding can be set up with the help of command-line options. There are several SSH command-line options. They are the following.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&nbsp;\u2022 -c<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;For non-IN data, -c is used to specify the query class.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u2022 -A<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">-A is used to enable the authentication agent connection&#8217;s forwarding.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u2022 -a<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">-a is used to disable the authentication agent connection&#8217;s forwarding.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&nbsp;\u2022 -C<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;On authoritative nameservers, -C is used to compare SOA records.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u2022 -l<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;Using AXFR, -I is used to listing all domain hosts.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&nbsp;\u2022 -m<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;The memory debugging flags, such as trace, usage, or record, is set by -m.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&nbsp;\u2022 -N<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;-N is used to alter the permitted number of dots before root lookup.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&nbsp;\u2022 -v<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;-v is utilized to print debugging messages for SSH connection. It is also used for the verbose result.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&nbsp;\u2022 -V<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;-V displays the version number of the SSH tool<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&nbsp;\u2022 -r<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;Recursive processing is disabled by using -r.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&nbsp;\u2022 -R<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;-R specifies the number of times UDP packets can be retried.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&nbsp;\u2022 -s<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;-s is used to stop the query when a SERVFAIL response is received.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&nbsp;\u2022 -t<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;The query type is specified with -t.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&nbsp;\u2022 -T<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;The TCP\/IP model is enabled using -T.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&nbsp;\u2022 -w<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;-w specifies the interminable response delay.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&nbsp;\u2022 -W<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;-W indicates how long to hang tight for an answer.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&nbsp;\u2022 -6<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;-6 is used for transporting IPv6 queries.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&nbsp;\u2022 -4<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;-4 is used for transporting IPv4 queries.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&nbsp;\u2022 -d<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;&nbsp;-d has the same use as -v.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&nbsp;\u2022 -i<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;IP6.INT reverse lookups rely on -i.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Working of SSH<\/strong><\/h2>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/tryrdp.com\/blog\/wp-content\/uploads\/2023\/03\/image-1024x538.png\" alt=\"\" class=\"wp-image-2793\" width=\"1212\" height=\"637\" srcset=\"https:\/\/tryrdp.com\/blog\/wp-content\/uploads\/2023\/03\/image-1024x538.png 1024w, https:\/\/tryrdp.com\/blog\/wp-content\/uploads\/2023\/03\/image-300x158.png 300w, https:\/\/tryrdp.com\/blog\/wp-content\/uploads\/2023\/03\/image-768x403.png 768w, https:\/\/tryrdp.com\/blog\/wp-content\/uploads\/2023\/03\/image.png 1400w\" sizes=\"auto, (max-width: 1212px) 100vw, 1212px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">A host and client are needed to establish an SSH connection. The client and host can be a domain name, server, or IP address. The SSH client and SSH server should be connected to each other. The client establishes the connection by utilizing the host information. The SSH client and SSH server will be connected if the credential provided is verified.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The following process is carried out while SSH working.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The client contacts the server to initiate the connection.&nbsp;<\/li>\n\n\n\n<li>Sends server public key.<\/li>\n\n\n\n<li>Set terms and open a secure channel.<\/li>\n\n\n\n<li>User login to an operating system hosted by the server<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Changing the SSH Port in Linux<\/strong><\/h2>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.elegantthemes.com\/blog\/wp-content\/uploads\/2018\/04\/ssh-featured-image.png\" alt=\"How to Connect to Your Website Via SSH (And Why You'd Want To)\" width=\"1307\" height=\"599\"\/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Following are the steps to change the SSH port in Linux.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1. Adjusting the Firewall<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A firewall is a network security system that monitors and filters incoming and outgoing network traffic to prevent unauthorized access to a network. Adjusting the firewall is the first step while changing the SSH port in Linux. Updating firewall settings is needed to accept the new port.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Run the following command to open the new SSH port if you use UFW (Uncomplicated Firewall) on Debian or Ubuntu.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo ufw allow 5522\/tcp<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Run the following command to open the new SSH port if you are utilizing UFW (Uncomplicated Firewall) on Fedora\/CentOS\/RHEL\/Oracle<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo firewall-cmd --permanent --zone=public --add-port=5522\/tcp<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo firewall-cmd --reload<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">2. Connecting SSH<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Connecting remotely to Debian, Ubuntu, and CentOS servers using SSH is the next step after adjusting the firewall. Run the following command to establish a connection.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh your_username@host_ip_address<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Run the following command if the machine you want to connect has verified the user name.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh host_ip_address<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Type the password and press enter key. For first-time connection, type yes to continue connecting and press enter key.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">3. Configuring SSH<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Run the following command to open the SSH configuration file \/etc\/ssh\/sshd_config in a text editor<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ find \/ -name \"sshd_config\" -print<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Find the line that starts with Port 22. This line typically begins with a hash (#) character. Enter the new SSH port number after erasing the hash #. The SSH service might not start if the configuration is wrong. For example, port #22 is edited as 5522.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">4. Save SSH File<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Save the SSH file after modifying the SSH file according to the needs and close it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;5. Restart SSH service<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The last step to change the SSH port in Linux is restarting the sshd service to make changes in the SSH port. Run the following command to restart the SSH service in Debian, Mint, and Ubuntu.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo service ssh restart<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"># Ubuntu\/Debian\/Mint Linux with systemd #<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo systemctl restart ssh<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">In order for the SSH daemon to bind on the new port, install the policycoreutils package in CentOS or RHEL and add the following rules to relax the SELinux policy.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"># yum install policycoreutils<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"># semanage port -a -t ssh_port_t -p tcp 34627<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"># semanage port -m -t ssh_port_t -p tcp 34627<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"># systemctl restart sshd<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"># netstat -tlpn| grep ssh<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"># ss -tlpn| grep ssh<\/p>\n<\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">Run the following command to restart SSH service in RHEL, CentOS, and Fedora.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo service sshd restart<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Run the following command to restart SSH service in RHEL, CentOS, and Fedora with systemd.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo systemctl restart sshd<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">After making changes, run the following command to establish an SSH connection.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh root@IP_address_of_the_server -p NewPort<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Conclusion&nbsp;<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In Linux, changing the SSH port is a simple process. The ssh port is defined in the sshd_config file. Editing the SSH configuration file and restarting the service are required to change the SSH port. Linux users can use SSH key-based authentication to connect to Linux servers without entering a password. The client SSH has many capabilities, such as file transfer, making, configuring, holding a key, opening the SSH server, etc.&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SSH (Secure Shell or Secure Socket Shell) is an open encrypted network protocol. It provides a safe way for users to access a computer to communicate and share data over an unsecured network. SSH uses &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"How to Change the SSH Port in Linux\" class=\"read-more button\" href=\"https:\/\/tryrdp.com\/blog\/change-the-ssh-port-in-linux\/#more-2225\" aria-label=\"More on How to Change the SSH Port in Linux\">Read more<\/a><\/p>\n","protected":false},"author":7,"featured_media":2791,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[51,32],"tags":[],"class_list":["post-2225","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-vps"],"featured_image_src":"https:\/\/tryrdp.com\/blog\/wp-content\/uploads\/2023\/01\/How-to-Change-the-SSH-Port-in-Linux.png","author_info":{"display_name":"Tithi Mukherjee","author_link":"https:\/\/tryrdp.com\/blog\/author\/tithi\/"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Change the SSH Port in Linux<\/title>\n<meta name=\"description\" content=\"Step-by-step instructions on how to change the SSH port in Linux. Learn how to enhance your server&#039;s security and protect against unauthorized access.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/tryrdp.com\/blog\/change-the-ssh-port-in-linux\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Change the SSH Port in Linux\" \/>\n<meta property=\"og:description\" content=\"Step-by-step instructions on how to change the SSH port in Linux. Learn how to enhance your server&#039;s security and protect against unauthorized access.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/tryrdp.com\/blog\/change-the-ssh-port-in-linux\/\" \/>\n<meta property=\"og:site_name\" content=\"TryRDP Blog\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/profile.php?id=100003803338568\" \/>\n<meta property=\"article:published_time\" content=\"2023-01-18T21:44:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-05-24T06:27:07+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/tryrdp.com\/blog\/wp-content\/uploads\/2023\/01\/How-to-Change-the-SSH-Port-in-Linux.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Tithi Mukherjee\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Tithi Mukherjee\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/tryrdp.com\\\/blog\\\/change-the-ssh-port-in-linux\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/tryrdp.com\\\/blog\\\/change-the-ssh-port-in-linux\\\/\"},\"author\":{\"name\":\"Tithi Mukherjee\",\"@id\":\"https:\\\/\\\/tryrdp.com\\\/blog\\\/#\\\/schema\\\/person\\\/6987ffd35a3b8930dfc6f1ce18128881\"},\"headline\":\"How to Change the SSH Port in Linux\",\"datePublished\":\"2023-01-18T21:44:05+00:00\",\"dateModified\":\"2026-05-24T06:27:07+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/tryrdp.com\\\/blog\\\/change-the-ssh-port-in-linux\\\/\"},\"wordCount\":1163,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/tryrdp.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/tryrdp.com\\\/blog\\\/change-the-ssh-port-in-linux\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/tryrdp.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/01\\\/How-to-Change-the-SSH-Port-in-Linux.png\",\"articleSection\":[\"Linux\",\"VPS\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/tryrdp.com\\\/blog\\\/change-the-ssh-port-in-linux\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/tryrdp.com\\\/blog\\\/change-the-ssh-port-in-linux\\\/\",\"url\":\"https:\\\/\\\/tryrdp.com\\\/blog\\\/change-the-ssh-port-in-linux\\\/\",\"name\":\"How to Change the SSH Port in Linux\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/tryrdp.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/tryrdp.com\\\/blog\\\/change-the-ssh-port-in-linux\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/tryrdp.com\\\/blog\\\/change-the-ssh-port-in-linux\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/tryrdp.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/01\\\/How-to-Change-the-SSH-Port-in-Linux.png\",\"datePublished\":\"2023-01-18T21:44:05+00:00\",\"dateModified\":\"2026-05-24T06:27:07+00:00\",\"description\":\"Step-by-step instructions on how to change the SSH port in Linux. Learn how to enhance your server's security and protect against unauthorized access.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/tryrdp.com\\\/blog\\\/change-the-ssh-port-in-linux\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/tryrdp.com\\\/blog\\\/change-the-ssh-port-in-linux\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/tryrdp.com\\\/blog\\\/change-the-ssh-port-in-linux\\\/#primaryimage\",\"url\":\"https:\\\/\\\/tryrdp.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/01\\\/How-to-Change-the-SSH-Port-in-Linux.png\",\"contentUrl\":\"https:\\\/\\\/tryrdp.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/01\\\/How-to-Change-the-SSH-Port-in-Linux.png\",\"width\":1920,\"height\":1080,\"caption\":\"Change the SSH Port in Linux\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/tryrdp.com\\\/blog\\\/change-the-ssh-port-in-linux\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/tryrdp.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Change the SSH Port in Linux\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/tryrdp.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/tryrdp.com\\\/blog\\\/\",\"name\":\"TryRDP Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/tryrdp.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/tryrdp.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/tryrdp.com\\\/blog\\\/#organization\",\"name\":\"TryRDP Blog\",\"url\":\"https:\\\/\\\/tryrdp.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/tryrdp.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/tryrdp.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/cropped-logolight-1.png\",\"contentUrl\":\"https:\\\/\\\/tryrdp.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/08\\\/cropped-logolight-1.png\",\"width\":300,\"height\":60,\"caption\":\"TryRDP Blog\"},\"image\":{\"@id\":\"https:\\\/\\\/tryrdp.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/tryrdp.com\\\/blog\\\/#\\\/schema\\\/person\\\/6987ffd35a3b8930dfc6f1ce18128881\",\"name\":\"Tithi Mukherjee\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/23f9430b19f9ee3482116460ac7e06397667bf8203e47007bd2879755eda318c?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/23f9430b19f9ee3482116460ac7e06397667bf8203e47007bd2879755eda318c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/23f9430b19f9ee3482116460ac7e06397667bf8203e47007bd2879755eda318c?s=96&d=mm&r=g\",\"caption\":\"Tithi Mukherjee\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/profile.php?id=100003803338568\",\"https:\\\/\\\/www.instagram.com\\\/tithiimukherjee_\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/sulagna-mukherjee-tithi\\\/\",\"https:\\\/\\\/www.youtube.com\\\/@NoobieTechsTithi_mukherjee\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Change the SSH Port in Linux","description":"Step-by-step instructions on how to change the SSH port in Linux. Learn how to enhance your server's security and protect against unauthorized access.","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:\/\/tryrdp.com\/blog\/change-the-ssh-port-in-linux\/","og_locale":"en_US","og_type":"article","og_title":"How to Change the SSH Port in Linux","og_description":"Step-by-step instructions on how to change the SSH port in Linux. Learn how to enhance your server's security and protect against unauthorized access.","og_url":"https:\/\/tryrdp.com\/blog\/change-the-ssh-port-in-linux\/","og_site_name":"TryRDP Blog","article_author":"https:\/\/www.facebook.com\/profile.php?id=100003803338568","article_published_time":"2023-01-18T21:44:05+00:00","article_modified_time":"2026-05-24T06:27:07+00:00","og_image":[{"width":1920,"height":1080,"url":"https:\/\/tryrdp.com\/blog\/wp-content\/uploads\/2023\/01\/How-to-Change-the-SSH-Port-in-Linux.png","type":"image\/png"}],"author":"Tithi Mukherjee","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Tithi Mukherjee","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/tryrdp.com\/blog\/change-the-ssh-port-in-linux\/#article","isPartOf":{"@id":"https:\/\/tryrdp.com\/blog\/change-the-ssh-port-in-linux\/"},"author":{"name":"Tithi Mukherjee","@id":"https:\/\/tryrdp.com\/blog\/#\/schema\/person\/6987ffd35a3b8930dfc6f1ce18128881"},"headline":"How to Change the SSH Port in Linux","datePublished":"2023-01-18T21:44:05+00:00","dateModified":"2026-05-24T06:27:07+00:00","mainEntityOfPage":{"@id":"https:\/\/tryrdp.com\/blog\/change-the-ssh-port-in-linux\/"},"wordCount":1163,"commentCount":0,"publisher":{"@id":"https:\/\/tryrdp.com\/blog\/#organization"},"image":{"@id":"https:\/\/tryrdp.com\/blog\/change-the-ssh-port-in-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/tryrdp.com\/blog\/wp-content\/uploads\/2023\/01\/How-to-Change-the-SSH-Port-in-Linux.png","articleSection":["Linux","VPS"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/tryrdp.com\/blog\/change-the-ssh-port-in-linux\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/tryrdp.com\/blog\/change-the-ssh-port-in-linux\/","url":"https:\/\/tryrdp.com\/blog\/change-the-ssh-port-in-linux\/","name":"How to Change the SSH Port in Linux","isPartOf":{"@id":"https:\/\/tryrdp.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/tryrdp.com\/blog\/change-the-ssh-port-in-linux\/#primaryimage"},"image":{"@id":"https:\/\/tryrdp.com\/blog\/change-the-ssh-port-in-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/tryrdp.com\/blog\/wp-content\/uploads\/2023\/01\/How-to-Change-the-SSH-Port-in-Linux.png","datePublished":"2023-01-18T21:44:05+00:00","dateModified":"2026-05-24T06:27:07+00:00","description":"Step-by-step instructions on how to change the SSH port in Linux. Learn how to enhance your server's security and protect against unauthorized access.","breadcrumb":{"@id":"https:\/\/tryrdp.com\/blog\/change-the-ssh-port-in-linux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/tryrdp.com\/blog\/change-the-ssh-port-in-linux\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/tryrdp.com\/blog\/change-the-ssh-port-in-linux\/#primaryimage","url":"https:\/\/tryrdp.com\/blog\/wp-content\/uploads\/2023\/01\/How-to-Change-the-SSH-Port-in-Linux.png","contentUrl":"https:\/\/tryrdp.com\/blog\/wp-content\/uploads\/2023\/01\/How-to-Change-the-SSH-Port-in-Linux.png","width":1920,"height":1080,"caption":"Change the SSH Port in Linux"},{"@type":"BreadcrumbList","@id":"https:\/\/tryrdp.com\/blog\/change-the-ssh-port-in-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/tryrdp.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Change the SSH Port in Linux"}]},{"@type":"WebSite","@id":"https:\/\/tryrdp.com\/blog\/#website","url":"https:\/\/tryrdp.com\/blog\/","name":"TryRDP Blog","description":"","publisher":{"@id":"https:\/\/tryrdp.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/tryrdp.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/tryrdp.com\/blog\/#organization","name":"TryRDP Blog","url":"https:\/\/tryrdp.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/tryrdp.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/tryrdp.com\/blog\/wp-content\/uploads\/2021\/08\/cropped-logolight-1.png","contentUrl":"https:\/\/tryrdp.com\/blog\/wp-content\/uploads\/2021\/08\/cropped-logolight-1.png","width":300,"height":60,"caption":"TryRDP Blog"},"image":{"@id":"https:\/\/tryrdp.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/tryrdp.com\/blog\/#\/schema\/person\/6987ffd35a3b8930dfc6f1ce18128881","name":"Tithi Mukherjee","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/23f9430b19f9ee3482116460ac7e06397667bf8203e47007bd2879755eda318c?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/23f9430b19f9ee3482116460ac7e06397667bf8203e47007bd2879755eda318c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/23f9430b19f9ee3482116460ac7e06397667bf8203e47007bd2879755eda318c?s=96&d=mm&r=g","caption":"Tithi Mukherjee"},"sameAs":["https:\/\/www.facebook.com\/profile.php?id=100003803338568","https:\/\/www.instagram.com\/tithiimukherjee_","https:\/\/www.linkedin.com\/in\/sulagna-mukherjee-tithi\/","https:\/\/www.youtube.com\/@NoobieTechsTithi_mukherjee"]}]}},"_links":{"self":[{"href":"https:\/\/tryrdp.com\/blog\/wp-json\/wp\/v2\/posts\/2225","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tryrdp.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tryrdp.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tryrdp.com\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/tryrdp.com\/blog\/wp-json\/wp\/v2\/comments?post=2225"}],"version-history":[{"count":1,"href":"https:\/\/tryrdp.com\/blog\/wp-json\/wp\/v2\/posts\/2225\/revisions"}],"predecessor-version":[{"id":4200,"href":"https:\/\/tryrdp.com\/blog\/wp-json\/wp\/v2\/posts\/2225\/revisions\/4200"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tryrdp.com\/blog\/wp-json\/wp\/v2\/media\/2791"}],"wp:attachment":[{"href":"https:\/\/tryrdp.com\/blog\/wp-json\/wp\/v2\/media?parent=2225"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tryrdp.com\/blog\/wp-json\/wp\/v2\/categories?post=2225"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tryrdp.com\/blog\/wp-json\/wp\/v2\/tags?post=2225"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}