{"id":47904,"date":"2024-02-28T12:30:00","date_gmt":"2024-02-28T18:30:00","guid":{"rendered":"https:\/\/www.rosehosting.com\/blog\/?p=47904"},"modified":"2024-01-24T06:05:43","modified_gmt":"2024-01-24T12:05:43","slug":"how-to-set-up-ssh-key-authentication-on-linux","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-ssh-key-authentication-on-linux\/","title":{"rendered":"How to Set up SSH Key Authentication on Linux"},"content":{"rendered":"<div id=\"bsf_rt_marker\"><\/div>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/01\/how-to-set-up-ssh-key-authentication-on-linux.webp\" alt=\"how to set up ssh key authentication on linux\" class=\"wp-image-47975\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/01\/how-to-set-up-ssh-key-authentication-on-linux.webp 1024w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/01\/how-to-set-up-ssh-key-authentication-on-linux-300x169.webp 300w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/01\/how-to-set-up-ssh-key-authentication-on-linux-150x84.webp 150w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/01\/how-to-set-up-ssh-key-authentication-on-linux-768x432.webp 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>With brute-force attacks becoming more and more common, it&#8217;s best to prevent any malicious users from ever being able to attempt to guess your password. That&#8217;s why it&#8217;s important to set up SSH key authentication on your Linux server. Using key-based authentication is a lot safer and can pretty much never be guessed by anyone else. It&#8217;s also super easy to set up. Let&#8217;s get right into it.<\/p>\n\n\n\n<!--more-->\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69eef2fc0353e\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"ez-toc-cssicon\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69eef2fc0353e\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-ssh-key-authentication-on-linux\/#1-Creating-your-own-SSH-key\" >1. Creating your own SSH key<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-ssh-key-authentication-on-linux\/#2-Copy-your-key-to-your-Linux-Server-with-ssh-copy-id\" >2. Copy your key to your Linux Server with ssh-copy-id<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-ssh-key-authentication-on-linux\/#21-Copy-your-key-when-ssh-copy-id-is-not-available\" >2.1. Copy your key when ssh-copy-id is not available<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-ssh-key-authentication-on-linux\/#Set-up-SSH-key-authentication-on-Windows\" >Set up SSH key authentication on Windows<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-ssh-key-authentication-on-linux\/#4-Disable-password-authentication-on-the-server-OPTIONAL\" >4. Disable password authentication on the server (OPTIONAL)<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1-Creating-your-own-SSH-key\"><\/span>1. Creating your own SSH key<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>On your local machine, you need to generate a new pair of keys in order to set up SSH key authentication. To do that, we&#8217;ll run:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ssh-keygen<\/pre>\n\n\n\n<p>You can then hit enter until the key is created. Or, if you want, you can setup a password on the step:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Enter passphrase (empty for no passphrase):<br>Enter same passphrase again:<\/pre>\n\n\n\n<p>Please keep a note of this password, as it will be required for every access to the server.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2-Copy-your-key-to-your-Linux-Server-with-ssh-copy-id\"><\/span>2. Copy your key to your Linux Server with ssh-copy-id<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>After your key is copied, there&#8217;s another command where you can copy your key to your server without needing to edit\/add to the <code>authorized_keys<\/code> file manually. You can do that by running the following:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ssh-copy-id user@host -p port_number<\/pre>\n\n\n\n<p>Just remember to change the username <code>user<\/code> to your actual username, and <code>host<\/code> to your server&#8217;s hostname or IP address. This will automatically copy your public key to your server, and after that, you can try to ssh to your server. You should not be prompted to provide a password, and you&#8217;ll be automatically logged in. To test it out, run:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ssh user@host -p port_number<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"21-Copy-your-key-when-ssh-copy-id-is-not-available\"><\/span>2.1. Copy your key when ssh-copy-id is not available<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In some systems, you might not have the command <code>ssh-copy-id<\/code> available, in that case, you&#8217;ll need to do it over a traditional SSH connection. To do that, we&#8217;ll run the following pre-made command. This will work on Linux systems:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cat ~\/.ssh\/id_rsa.pub | ssh user@host -p port_number \"mkdir -p ~\/.ssh &amp;&amp; cat &gt;&gt; ~\/.ssh\/authorized_keys &amp;&amp; chmod 700 -R ~\/.ssh\"<\/pre>\n\n\n\n<p>Just remember to change the username <code>user<\/code> to your actual username, and <code>host<\/code> to your server&#8217;s hostname or IP address. This should do all the work for you &#8211; that one line will copy your local key to your server and insert it into your <code>authorized_keys<\/code> file.<\/p>\n\n\n\n<p>You can test it after you run this command by trying to SSH into your server:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ssh user@host -p port_number<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Set-up-SSH-key-authentication-on-Windows\"><\/span>Set up SSH key authentication on Windows<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Windows doesn&#8217;t come with the commands we show in step 2.1, so here is what you need to do to set up SSH key authentication if you&#8217;re running Windows. This guide&#8217;s steps are meant for readers that are running Windows 11. <\/p>\n\n\n\n<p>First, open the Terminal application (not as an administrator). You&#8217;ll then need to run the <code>ssh-keygen.exe<\/code> command, like so:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">PS C:\\Users\\rosehosting&gt; ssh-keygen.exe<\/pre>\n\n\n\n<p>You&#8217;ll then get a few questions. You can use the default directory, and then set no passphrase (you can also set one if you prefer, but you&#8217;ll need to enter your passphrase every time you want to authenticate using your key. Here&#8217;s how our output looked:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Generating public\/private rsa key pair.\nEnter file in which to save the key (C:\\Users\\rosehosting\/.ssh\/id_rsa):\nCreated directory 'C:\\\\Users\\\\rosehosting\/.ssh'.\nEnter passphrase (empty for no passphrase):\nEnter same passphrase again:\nYour identification has been saved in C:\\Users\\rosehosting\/.ssh\/id_rsa\nYour public key has been saved in C:\\Users\\rosehosting\/.ssh\/id_rsa.pub<\/pre>\n\n\n\n<p>You now have a saved keypair. You will now need to copy the public key (the one named <code>id_rsa.pub<\/code>) to your server. First, print the public key in your terminal and copy it:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">PS C:\\Users\\rosehosting&gt; cat .\\.ssh\\id_rsa.pub<\/pre>\n\n\n\n<p>Then SSH into your server:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">PS C:\\Users\\rosehosting&gt; ssh.exe user@host -p port_number<\/pre>\n\n\n\n<p>Run this command to create the folder where your SSH public key will be stored:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mkdir -p ~\/.ssh<\/pre>\n\n\n\n<p>You can then open a new file using your preferred text editor. We&#8217;ll use nano:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">nano ~\/.ssh\/authorized_keys<\/pre>\n\n\n\n<p>Paste your public key into the file, save, and exit. You then need to update the file permissions on the new folder and file:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">chmod 700 -R ~\/.ssh<\/pre>\n\n\n\n<p>With that, your key access should be all set up. You can now log out of your server and try to log back in. You should not be prompted to enter a password anymore.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"4-Disable-password-authentication-on-the-server-OPTIONAL\"><\/span>4. Disable password authentication on the server (OPTIONAL)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>If you want to keep your server even more secure, you can disable the password authentication on your server. This means all users on the system will have to use ssh keys to log into it. SSH keys are more secure than passwords because they provide a stronger and more resilient authentication method. Unlike passwords which can be susceptible to brute-force attacks and other vulnerabilities, SSH keys use a pair of cryptographic keys for authentication. This makes it significantly harder for unauthorized users to gain access, enhancing overall security. Additionally, SSH keys eliminate the need to transmit passwords over the network, reducing the risk of interception and unauthorized access.<\/p>\n\n\n\n<p>To disable password authentication, you need to edit the SSH server configuration file on your server:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo nano \/etc\/ssh\/sshd_config<\/pre>\n\n\n\n<p>In there, you should find the line <code>PasswordAuthentication<\/code> &#8211; set it to no:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">PasswordAuthentication no<\/pre>\n\n\n\n<p>After you finish the edit and close the file, you can restart your SSH service, and you should be good to go:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">systemctl restart ssh<\/pre>\n\n\n\n<p>That&#8217;s it! You successfully configured your server to use SSH keys instead of passwords. This will make your server even more secure against potential brute force attacks, anyone knowing your password, etc. If you have an active <a href=\"https:\/\/www.rosehosting.com\/linux-vps-hosting\/\">Managed Linux VPS<\/a> server with us, you don&#8217;t need to do anything from above &#8211; you can submit a support ticket to our team with your public key and our team will add it for you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>With brute-force attacks becoming more and more common, it&#8217;s best to prevent any malicious users from ever being able to &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"How to Set up SSH Key Authentication on Linux\" class=\"read-more button\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-ssh-key-authentication-on-linux\/#more-47904\" aria-label=\"Read more about How to Set up SSH Key Authentication on Linux\">Read More<\/a><\/p>\n","protected":false},"author":4,"featured_media":47975,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1703,13],"tags":[27,65,68],"class_list":["post-47904","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-security","category-tutorials","tag-linux","tag-security","tag-ssh","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-33"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.4 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to Set up SSH Key Authentication on Linux | RoseHosting<\/title>\n<meta name=\"description\" content=\"Protect your server and your data from potential security vulnerabilities. Set up SSH key authentication - it only takes a few minutes.\" \/>\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.rosehosting.com\/blog\/how-to-set-up-ssh-key-authentication-on-linux\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Set up SSH Key Authentication on Linux\" \/>\n<meta property=\"og:description\" content=\"How to Set up SSH Key Authentication on Linux | RoseHosting\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-ssh-key-authentication-on-linux\/\" \/>\n<meta property=\"og:site_name\" content=\"RoseHosting\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/RoseHosting\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/rosehosting.helpdesk\" \/>\n<meta property=\"article:published_time\" content=\"2024-02-28T18:30:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/01\/how-to-set-up-ssh-key-authentication-on-linux.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"576\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"Jeff Wilson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@rosehosting\" \/>\n<meta name=\"twitter:site\" content=\"@rosehosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeff Wilson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-set-up-ssh-key-authentication-on-linux\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-set-up-ssh-key-authentication-on-linux\\\/\"},\"author\":{\"name\":\"Jeff Wilson\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/person\\\/7ce77a842fa6a9a7f8efa186f2353713\"},\"headline\":\"How to Set up SSH Key Authentication on Linux\",\"datePublished\":\"2024-02-28T18:30:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-set-up-ssh-key-authentication-on-linux\\\/\"},\"wordCount\":852,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-set-up-ssh-key-authentication-on-linux\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/how-to-set-up-ssh-key-authentication-on-linux.webp\",\"keywords\":[\"Linux\",\"security\",\"ssh\"],\"articleSection\":[\"Security\",\"Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-set-up-ssh-key-authentication-on-linux\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-set-up-ssh-key-authentication-on-linux\\\/\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-set-up-ssh-key-authentication-on-linux\\\/\",\"name\":\"How to Set up SSH Key Authentication on Linux | RoseHosting\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-set-up-ssh-key-authentication-on-linux\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-set-up-ssh-key-authentication-on-linux\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/how-to-set-up-ssh-key-authentication-on-linux.webp\",\"datePublished\":\"2024-02-28T18:30:00+00:00\",\"description\":\"Protect your server and your data from potential security vulnerabilities. Set up SSH key authentication - it only takes a few minutes.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-set-up-ssh-key-authentication-on-linux\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-set-up-ssh-key-authentication-on-linux\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-set-up-ssh-key-authentication-on-linux\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/how-to-set-up-ssh-key-authentication-on-linux.webp\",\"contentUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/how-to-set-up-ssh-key-authentication-on-linux.webp\",\"width\":1024,\"height\":576,\"caption\":\"how to set up ssh key authentication on linux\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-set-up-ssh-key-authentication-on-linux\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Set up SSH Key Authentication on Linux\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\",\"name\":\"RoseHosting.com\",\"description\":\"Premium Linux Tutorials Since 2001\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\",\"name\":\"RoseHosting\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/android-chrome-192x192-1.png\",\"contentUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/android-chrome-192x192-1.png\",\"width\":192,\"height\":192,\"caption\":\"RoseHosting\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/RoseHosting\",\"https:\\\/\\\/x.com\\\/rosehosting\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/rosehosting\\\/\"],\"description\":\"RoseHosting is a leading Linux hosting provider, serving thousands of clients world-wide since 2001.\",\"email\":\"info@rosehosting.com\",\"telephone\":\"(314) 275-0414\",\"legalName\":\"Rose Web Services LLC\",\"foundingDate\":\"2001-04-02\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"11\",\"maxValue\":\"50\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/person\\\/7ce77a842fa6a9a7f8efa186f2353713\",\"name\":\"Jeff Wilson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"caption\":\"Jeff Wilson\"},\"description\":\"An experienced Linux veteran with many years of experience. Helping other Linux admins with frequent Linux and business-related blog posts on the RoseHosting blog. Techie by choice. Loving nature and travel. Happily married and father of two lovely children.\",\"sameAs\":[\"https:\\\/\\\/www.rosehosting.com\",\"https:\\\/\\\/www.facebook.com\\\/rosehosting.helpdesk\"],\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/author\\\/jwilson\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Set up SSH Key Authentication on Linux | RoseHosting","description":"Protect your server and your data from potential security vulnerabilities. Set up SSH key authentication - it only takes a few minutes.","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.rosehosting.com\/blog\/how-to-set-up-ssh-key-authentication-on-linux\/","og_locale":"en_US","og_type":"article","og_title":"How to Set up SSH Key Authentication on Linux","og_description":"How to Set up SSH Key Authentication on Linux | RoseHosting","og_url":"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-ssh-key-authentication-on-linux\/","og_site_name":"RoseHosting","article_publisher":"https:\/\/www.facebook.com\/RoseHosting","article_author":"https:\/\/www.facebook.com\/rosehosting.helpdesk","article_published_time":"2024-02-28T18:30:00+00:00","og_image":[{"width":1024,"height":576,"url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/01\/how-to-set-up-ssh-key-authentication-on-linux.webp","type":"image\/webp"}],"author":"Jeff Wilson","twitter_card":"summary_large_image","twitter_creator":"@rosehosting","twitter_site":"@rosehosting","twitter_misc":{"Written by":"Jeff Wilson","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-ssh-key-authentication-on-linux\/#article","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-ssh-key-authentication-on-linux\/"},"author":{"name":"Jeff Wilson","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713"},"headline":"How to Set up SSH Key Authentication on Linux","datePublished":"2024-02-28T18:30:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-ssh-key-authentication-on-linux\/"},"wordCount":852,"commentCount":0,"publisher":{"@id":"https:\/\/www.rosehosting.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-ssh-key-authentication-on-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/01\/how-to-set-up-ssh-key-authentication-on-linux.webp","keywords":["Linux","security","ssh"],"articleSection":["Security","Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.rosehosting.com\/blog\/how-to-set-up-ssh-key-authentication-on-linux\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-ssh-key-authentication-on-linux\/","url":"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-ssh-key-authentication-on-linux\/","name":"How to Set up SSH Key Authentication on Linux | RoseHosting","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-ssh-key-authentication-on-linux\/#primaryimage"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-ssh-key-authentication-on-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/01\/how-to-set-up-ssh-key-authentication-on-linux.webp","datePublished":"2024-02-28T18:30:00+00:00","description":"Protect your server and your data from potential security vulnerabilities. Set up SSH key authentication - it only takes a few minutes.","breadcrumb":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-ssh-key-authentication-on-linux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.rosehosting.com\/blog\/how-to-set-up-ssh-key-authentication-on-linux\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-ssh-key-authentication-on-linux\/#primaryimage","url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/01\/how-to-set-up-ssh-key-authentication-on-linux.webp","contentUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2024\/01\/how-to-set-up-ssh-key-authentication-on-linux.webp","width":1024,"height":576,"caption":"how to set up ssh key authentication on linux"},{"@type":"BreadcrumbList","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-set-up-ssh-key-authentication-on-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.rosehosting.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Set up SSH Key Authentication on Linux"}]},{"@type":"WebSite","@id":"https:\/\/www.rosehosting.com\/blog\/#website","url":"https:\/\/www.rosehosting.com\/blog\/","name":"RoseHosting.com","description":"Premium Linux Tutorials Since 2001","publisher":{"@id":"https:\/\/www.rosehosting.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.rosehosting.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.rosehosting.com\/blog\/#organization","name":"RoseHosting","url":"https:\/\/www.rosehosting.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png","contentUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png","width":192,"height":192,"caption":"RoseHosting"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/RoseHosting","https:\/\/x.com\/rosehosting","https:\/\/www.linkedin.com\/in\/rosehosting\/"],"description":"RoseHosting is a leading Linux hosting provider, serving thousands of clients world-wide since 2001.","email":"info@rosehosting.com","telephone":"(314) 275-0414","legalName":"Rose Web Services LLC","foundingDate":"2001-04-02","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"11","maxValue":"50"}},{"@type":"Person","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713","name":"Jeff Wilson","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","caption":"Jeff Wilson"},"description":"An experienced Linux veteran with many years of experience. Helping other Linux admins with frequent Linux and business-related blog posts on the RoseHosting blog. Techie by choice. Loving nature and travel. Happily married and father of two lovely children.","sameAs":["https:\/\/www.rosehosting.com","https:\/\/www.facebook.com\/rosehosting.helpdesk"],"url":"https:\/\/www.rosehosting.com\/blog\/author\/jwilson\/"}]}},"_links":{"self":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/47904","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/comments?post=47904"}],"version-history":[{"count":13,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/47904\/revisions"}],"predecessor-version":[{"id":47976,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/47904\/revisions\/47976"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media\/47975"}],"wp:attachment":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media?parent=47904"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/categories?post=47904"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/tags?post=47904"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}