{"id":1466,"date":"2021-04-21T11:30:00","date_gmt":"2021-04-21T16:30:00","guid":{"rendered":"https:\/\/www.linuxcloudvps.com\/blog\/?p=1466"},"modified":"2021-04-01T11:57:18","modified_gmt":"2021-04-01T16:57:18","slug":"how-to-harden-openssh-on-ubuntu-20-04","status":"publish","type":"post","link":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-harden-openssh-on-ubuntu-20-04\/","title":{"rendered":"How To Harden OpenSSH on Ubuntu 20.04"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">OpenSSH is one of the most popular tools that uses SSH protocol for secure system administration, file transfers, and other communication across the Internet. It is free and used by system administrators to manage remote systems. OpenSSH runs on port 22 and it is the first target of a hacker. So you may need to harden your OpenSSH server to protect it from hackers.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p class=\"wp-block-paragraph\">In this tutorial, we will show you different ways to harden an OpenSSH server.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"alignright size-large is-resized\"><a href=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2021\/03\/tips-on-how-to-harden-openssh-on-ubuntu-20.04.png\"><img decoding=\"async\" src=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2021\/03\/tips-on-how-to-harden-openssh-on-ubuntu-20.04.png\" alt=\"tips on how to harden openssh on ubuntu 20.04\" class=\"wp-image-1472\" width=\"148\" height=\"111\" srcset=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2021\/03\/tips-on-how-to-harden-openssh-on-ubuntu-20.04.png 770w, https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2021\/03\/tips-on-how-to-harden-openssh-on-ubuntu-20.04-400x300.png 400w, https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2021\/03\/tips-on-how-to-harden-openssh-on-ubuntu-20.04-768x576.png 768w\" sizes=\"(max-width: 148px) 100vw, 148px\" \/><\/a><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-prerequisites\">Prerequisites<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>A server running Linux operating system.<\/li><li>Access to the root user account (or access to an admin account with root privileges)<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-log-in-to-the-server-update-the-server-os-packages\">Log in to the Server &amp; Update the Server OS Packages<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">First, log in to your Ubuntu 20.04 server via SSH as the root user:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ssh root@IP_Address -p Port_number<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You will need to replace &#8216;IP_Address&#8217; and &#8216;Port_number&#8217; with your server\u2019s respective IP address and SSH port number. Additionally, replace &#8216;root&#8217; with the username of the admin account if necessary.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before starting, you have to make sure that all Ubuntu OS packages installed on the server are up to date. You can do this by running the following commands:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">apt-get update -y\napt-get upgrade -y<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-1-change-the-default-ssh-port\">1 &#8211; Change the Default SSH Port<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">By default, OpenSSH listens on port 22. So it is recommended to change the default port to avoid automated attacks on your server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can change the SSH default port by editing the file \/etc\/ssh\/sshd_config:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">nano \/etc\/ssh\/sshd_config<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Find the following line:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Port 22\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">And, replaced it with your desired port:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Port 8087<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Save and close the file then restart the SSH service to apply the changes:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">systemctl restart sshd<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now, verify the SSH connection using the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ssh -p 8087 root@your-server-ip<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-2-disable-ssh-root-login\">2 &#8211; Disable SSH Root Login<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">By default, every Linux system has a root account so it is the main target of hackers. So it is a good idea to disallow root user to login via SSH.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First, create a user and add it to sudo group with the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">adduser username\nusermod -aG sudo username<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Next, verify whether a new user can login via SSH. Then, edit the SSH default configuration file:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">nano \/etc\/ssh\/sshd_config<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Find the following line:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">PermitRootLogin yes<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">And, change it with the following:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">PermitRootLogin no<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Save and close this file. Then restart SSH service for the changes to take effect.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">systemctl restart sshd<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-3-disable-password-authentication-and-use-public-key-authentication\">3 &#8211; Disable Password Authentication and Use Public Key Authentication<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The attacker has to figure out the username and trying to brute force the password. So it better to use public key authentication instead of password authentication. So the only user that has private key can login to your server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can disable the password authentication and enable the key-based authentication by editing the file \/etc\/ssh\/sshd_config:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">nano \/etc\/ssh\/sshd_config<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Change the following lines:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">PasswordAuthentication no\nPubkeyAuthentication yes<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Save and close the file. Then restart SSH service for the changes to take effect.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">systemctl restart sshd<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-4-restrict-ssh-access-using-iptables\">4 &#8211; Restrict SSH Access Using iptables<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Iptables is a firewall tool used for filtering incoming and outgoing traffic to your server. You can create an Iptable rule to allow only a specific IP address or subnet for incoming SSH connections. This way you can block <a href=\"https:\/\/www.linuxcloudvps.com\/blog\/how-to-set-up-ssh-keys-on-centos-7\/\">SSH<\/a> connections for other users.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, to allow incoming SSH connection only for IP 192.168.0.100, run the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">iptables -A INPUT -p tcp -s 192.168.0.100 -dport 22 -j ACCEPT<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Next, save the Iptables rules with the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">iptables-save<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-5-define-ip-address-allow-list\">5 &#8211; Define IP Address Allow list<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You can also define and set up an IP address allow list to restrict incoming SSH connection based on IP address. This will reduce the risk of a breach in the event when your password is leaked.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can setup IP address whitelist by editing the SSH default configuration file:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">nano \/etc\/ssh\/sshd_config<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To allow a single IP address, add the following line:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">AllowUsers *@192.168.0.100<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To allow a whole subnet, add the following line:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">AllowUsers *@192.168.0.0\/24<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To allow multiple IP addresses, add the following line:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">AllowUsers *@192.168.0.100 *@192.168.0.101 *@172.16.0.124<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If you want to allow only a specific user to a specific IP address, add the following line:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Match User user1\n  AllowUsers user1@192.168.100.123\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Save and close the file when you are finished then restart the SSH service to apply the changes:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">systemctl restart sshd<\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"alignright size-large is-resized\"><a href=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2021\/03\/tips-on-how-to-harden-openssh-on-ubuntu-20.04.png\"><img decoding=\"async\" src=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2021\/03\/tips-on-how-to-harden-openssh-on-ubuntu-20.04.png\" alt=\"tips on how to harden openssh on ubuntu 20.04\" class=\"wp-image-1472\" width=\"108\" height=\"81\" srcset=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2021\/03\/tips-on-how-to-harden-openssh-on-ubuntu-20.04.png 770w, https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2021\/03\/tips-on-how-to-harden-openssh-on-ubuntu-20.04-400x300.png 400w, https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2021\/03\/tips-on-how-to-harden-openssh-on-ubuntu-20.04-768x576.png 768w\" sizes=\"(max-width: 108px) 100vw, 108px\" \/><\/a><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Of course, you don\u2019t have to secure SSH on Linux if you use one of our <a href=\"https:\/\/www.linuxcloudvps.com\/cloud-vps.html\">Managed Hosting services<\/a>, in which case you can simply ask our expert Linux admins to configure this for you. They are available 24\u00d77 and will take care of your request immediately.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">PS. If you liked this post on how to harden OpenSSH on Ubuntu, please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>OpenSSH is one of the most popular tools that uses SSH protocol for secure system administration, file transfers, and other communication across the Internet. It is free and used by system administrators to manage remote systems. OpenSSH runs on port 22 and it is the first target of a hacker. So you may need to &#8230; <a title=\"How To Harden OpenSSH on Ubuntu 20.04\" class=\"read-more\" href=\"https:\/\/www.linuxcloudvps.com\/blog\/how-to-harden-openssh-on-ubuntu-20-04\/\" aria-label=\"More on How To Harden OpenSSH on Ubuntu 20.04\">Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":1470,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[207,204,13,208,205],"tags":[118,209,47,210],"class_list":["post-1466","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-guide","category-openssh","category-tutorials","category-ubuntu","category-ubuntu-20-04","tag-how-to","tag-openssh","tag-ubuntu","tag-ubuntu-20-04"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How To Harden OpenSSH on Ubuntu 20.04 | LinuxCloudVPS Blog<\/title>\n<meta name=\"description\" content=\"OpenSSH is one of the most popular tools that uses SSH protocol for secure system administration, file transfers, and other communication across the\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.linuxcloudvps.com\/blog\/how-to-harden-openssh-on-ubuntu-20-04\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Harden OpenSSH on Ubuntu 20.04 | LinuxCloudVPS Blog\" \/>\n<meta property=\"og:description\" content=\"OpenSSH is one of the most popular tools that uses SSH protocol for secure system administration, file transfers, and other communication across the\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.linuxcloudvps.com\/blog\/how-to-harden-openssh-on-ubuntu-20-04\/\" \/>\n<meta property=\"og:site_name\" content=\"LinuxCloudVPS Blog\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/www.facebook.com\/LinuxCloudVPS\" \/>\n<meta property=\"article:published_time\" content=\"2021-04-21T16:30:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2021\/03\/how-to-harden-openssh-on-ubuntu-20.04.gif\" \/>\n\t<meta property=\"og:image:width\" content=\"578\" \/>\n\t<meta property=\"og:image:height\" content=\"191\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/gif\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@LinuxCloudVPS\" \/>\n<meta name=\"twitter:site\" content=\"@LinuxCloudVPS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-harden-openssh-on-ubuntu-20-04\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-harden-openssh-on-ubuntu-20-04\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#\\\/schema\\\/person\\\/ed907227ee7d151c617e6d0fe74f531a\"},\"headline\":\"How To Harden OpenSSH on Ubuntu 20.04\",\"datePublished\":\"2021-04-21T16:30:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-harden-openssh-on-ubuntu-20-04\\\/\"},\"wordCount\":723,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-harden-openssh-on-ubuntu-20-04\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/how-to-harden-openssh-on-ubuntu-20.04.gif\",\"keywords\":[\"how to\",\"OpenSSH\",\"ubuntu\",\"ubuntu 20.04\"],\"articleSection\":[\"Guide\",\"OpenSSH\",\"Tutorials\",\"Ubuntu\",\"Ubuntu 20.04\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-harden-openssh-on-ubuntu-20-04\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-harden-openssh-on-ubuntu-20-04\\\/\",\"url\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-harden-openssh-on-ubuntu-20-04\\\/\",\"name\":\"How To Harden OpenSSH on Ubuntu 20.04 | LinuxCloudVPS Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-harden-openssh-on-ubuntu-20-04\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-harden-openssh-on-ubuntu-20-04\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/how-to-harden-openssh-on-ubuntu-20.04.gif\",\"datePublished\":\"2021-04-21T16:30:00+00:00\",\"description\":\"OpenSSH is one of the most popular tools that uses SSH protocol for secure system administration, file transfers, and other communication across the\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-harden-openssh-on-ubuntu-20-04\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-harden-openssh-on-ubuntu-20-04\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-harden-openssh-on-ubuntu-20-04\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/how-to-harden-openssh-on-ubuntu-20.04.gif\",\"contentUrl\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/how-to-harden-openssh-on-ubuntu-20.04.gif\",\"width\":578,\"height\":191,\"caption\":\"how to harden openssh on ubuntu 20.04\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/how-to-harden-openssh-on-ubuntu-20-04\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Harden OpenSSH on Ubuntu 20.04\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/\",\"name\":\"LinuxCloudVPS\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#organization\",\"name\":\"LinuxCloudVPS\",\"url\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/logo.png\",\"contentUrl\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/logo.png\",\"width\":217,\"height\":25,\"caption\":\"LinuxCloudVPS\"},\"image\":{\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"http:\\\/\\\/www.facebook.com\\\/LinuxCloudVPS\",\"https:\\\/\\\/x.com\\\/LinuxCloudVPS\",\"http:\\\/\\\/www.linkedin.com\\\/company\\\/linuxcloudvps-com\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/#\\\/schema\\\/person\\\/ed907227ee7d151c617e6d0fe74f531a\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"sameAs\":[\"http:\\\/\\\/www.linuxcloudvps.com\\\/\"],\"url\":\"https:\\\/\\\/www.linuxcloudvps.com\\\/blog\\\/author\\\/r0s3admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How To Harden OpenSSH on Ubuntu 20.04 | LinuxCloudVPS Blog","description":"OpenSSH is one of the most popular tools that uses SSH protocol for secure system administration, file transfers, and other communication across the","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-harden-openssh-on-ubuntu-20-04\/","og_locale":"en_US","og_type":"article","og_title":"How To Harden OpenSSH on Ubuntu 20.04 | LinuxCloudVPS Blog","og_description":"OpenSSH is one of the most popular tools that uses SSH protocol for secure system administration, file transfers, and other communication across the","og_url":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-harden-openssh-on-ubuntu-20-04\/","og_site_name":"LinuxCloudVPS Blog","article_publisher":"http:\/\/www.facebook.com\/LinuxCloudVPS","article_published_time":"2021-04-21T16:30:00+00:00","og_image":[{"width":578,"height":191,"url":"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2021\/03\/how-to-harden-openssh-on-ubuntu-20.04.gif","type":"image\/gif"}],"author":"admin","twitter_card":"summary_large_image","twitter_creator":"@LinuxCloudVPS","twitter_site":"@LinuxCloudVPS","twitter_misc":{"Written by":"admin","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-harden-openssh-on-ubuntu-20-04\/#article","isPartOf":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-harden-openssh-on-ubuntu-20-04\/"},"author":{"name":"admin","@id":"https:\/\/www.linuxcloudvps.com\/blog\/#\/schema\/person\/ed907227ee7d151c617e6d0fe74f531a"},"headline":"How To Harden OpenSSH on Ubuntu 20.04","datePublished":"2021-04-21T16:30:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-harden-openssh-on-ubuntu-20-04\/"},"wordCount":723,"commentCount":0,"publisher":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-harden-openssh-on-ubuntu-20-04\/#primaryimage"},"thumbnailUrl":"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2021\/03\/how-to-harden-openssh-on-ubuntu-20.04.gif","keywords":["how to","OpenSSH","ubuntu","ubuntu 20.04"],"articleSection":["Guide","OpenSSH","Tutorials","Ubuntu","Ubuntu 20.04"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.linuxcloudvps.com\/blog\/how-to-harden-openssh-on-ubuntu-20-04\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-harden-openssh-on-ubuntu-20-04\/","url":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-harden-openssh-on-ubuntu-20-04\/","name":"How To Harden OpenSSH on Ubuntu 20.04 | LinuxCloudVPS Blog","isPartOf":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-harden-openssh-on-ubuntu-20-04\/#primaryimage"},"image":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-harden-openssh-on-ubuntu-20-04\/#primaryimage"},"thumbnailUrl":"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2021\/03\/how-to-harden-openssh-on-ubuntu-20.04.gif","datePublished":"2021-04-21T16:30:00+00:00","description":"OpenSSH is one of the most popular tools that uses SSH protocol for secure system administration, file transfers, and other communication across the","breadcrumb":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-harden-openssh-on-ubuntu-20-04\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.linuxcloudvps.com\/blog\/how-to-harden-openssh-on-ubuntu-20-04\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-harden-openssh-on-ubuntu-20-04\/#primaryimage","url":"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2021\/03\/how-to-harden-openssh-on-ubuntu-20.04.gif","contentUrl":"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2021\/03\/how-to-harden-openssh-on-ubuntu-20.04.gif","width":578,"height":191,"caption":"how to harden openssh on ubuntu 20.04"},{"@type":"BreadcrumbList","@id":"https:\/\/www.linuxcloudvps.com\/blog\/how-to-harden-openssh-on-ubuntu-20-04\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.linuxcloudvps.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How To Harden OpenSSH on Ubuntu 20.04"}]},{"@type":"WebSite","@id":"https:\/\/www.linuxcloudvps.com\/blog\/#website","url":"https:\/\/www.linuxcloudvps.com\/blog\/","name":"LinuxCloudVPS","description":"","publisher":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.linuxcloudvps.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.linuxcloudvps.com\/blog\/#organization","name":"LinuxCloudVPS","url":"https:\/\/www.linuxcloudvps.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.linuxcloudvps.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2023\/08\/logo.png","contentUrl":"https:\/\/www.linuxcloudvps.com\/blog\/wp-content\/uploads\/2023\/08\/logo.png","width":217,"height":25,"caption":"LinuxCloudVPS"},"image":{"@id":"https:\/\/www.linuxcloudvps.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["http:\/\/www.facebook.com\/LinuxCloudVPS","https:\/\/x.com\/LinuxCloudVPS","http:\/\/www.linkedin.com\/company\/linuxcloudvps-com"]},{"@type":"Person","@id":"https:\/\/www.linuxcloudvps.com\/blog\/#\/schema\/person\/ed907227ee7d151c617e6d0fe74f531a","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","caption":"admin"},"sameAs":["http:\/\/www.linuxcloudvps.com\/"],"url":"https:\/\/www.linuxcloudvps.com\/blog\/author\/r0s3admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/posts\/1466","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/comments?post=1466"}],"version-history":[{"count":5,"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/posts\/1466\/revisions"}],"predecessor-version":[{"id":1473,"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/posts\/1466\/revisions\/1473"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/media\/1470"}],"wp:attachment":[{"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/media?parent=1466"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/categories?post=1466"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcloudvps.com\/blog\/wp-json\/wp\/v2\/tags?post=1466"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}