{"id":6286,"date":"2019-07-25T10:55:05","date_gmt":"2019-07-25T10:55:05","guid":{"rendered":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/?p=6286"},"modified":"2019-08-02T10:59:24","modified_gmt":"2019-08-02T10:59:24","slug":"how-to-set-up-ssh-keys-on-ubuntu-18-04","status":"publish","type":"post","link":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-set-up-ssh-keys-on-ubuntu-18-04\/","title":{"rendered":"How to Set Up SSH Keys on Ubuntu 18.04"},"content":{"rendered":"<p><a href=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2019\/08\/How-to-Set-Up-SSH-Keys-on-Ubuntu-18.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-6287\" src=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2019\/08\/How-to-Set-Up-SSH-Keys-on-Ubuntu-18.png\" alt=\"How to Set Up SSH Keys on Ubuntu 18.04\" width=\"800\" height=\"445\" srcset=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2019\/08\/How-to-Set-Up-SSH-Keys-on-Ubuntu-18.png 800w, https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2019\/08\/How-to-Set-Up-SSH-Keys-on-Ubuntu-18-300x167.png 300w, https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2019\/08\/How-to-Set-Up-SSH-Keys-on-Ubuntu-18-768x427.png 768w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/a><\/p>\n<h2>Introduction<\/h2>\n<p style=\"text-align: justify;\">SSH (secure shell) is the encrypted protocol used to administer and interact with servers. You will spend maximum time in the terminal session connected to your server through SSH when working with an Ubuntu server.<\/p>\n<p style=\"text-align: justify;\">In this guide, you will learn how to set up SSH keys for Ubuntu 18.04 installation. SSH keys deliver an easy and secure way of logging into your server also is recommended for all users.<\/p>\n<h2>STEP 1 &#8211; Create the RSA Key Pair<\/h2>\n<p>Create a key pair on the client machine (generally your computer):<\/p>\n<div style=\"background: #f2f2f2; padding: 15px;\">\n<div>ssh-keygen<\/div>\n<\/div>\n<p style=\"text-align: justify;\"><em>ssh-keygen<\/em> will create a 2048-bit RSA key pair by default, which is safe for most used cases (you can pass in the <em>-b 4096<\/em> flag to create a higher 4096-bit key optionally).<\/p>\n<p style=\"text-align: justify;\">After executing the command, you will see the following output:<\/p>\n<div style=\"background: #f2f2f2; padding: 15px;\">\n<div><em><strong>Output<\/strong><\/em><\/div>\n<div>Generating public\/private rsa key pair.<\/div>\n<div>Enter file in which to save the key (\/<span style=\"color: #ff0000;\">your_home<\/span>\/.ssh\/id_rsa):<\/div>\n<\/div>\n<p style=\"text-align: justify;\">Hit Enter to save the key pair into the <em>.ssh\/<\/em> subdirectory in your root (home) directory or define an alternate path.<\/p>\n<p style=\"text-align: justify;\">You may see the following prompt if you had generated an SSH key pair previously:<\/p>\n<div style=\"background: #f2f2f2; padding: 15px;\">\n<div><em><strong>Output<\/strong><\/em><\/div>\n<div>\/home\/<span style=\"color: #ff0000;\">your_home<\/span>\/.ssh\/id_rsa already exists.<\/div>\n<div>Overwrite (y\/n)?<\/div>\n<\/div>\n<p style=\"text-align: justify;\">If you want to overwrite the key on disk, you will be unable to verify using the previous key anymore. Be very careful when choosing yes because this is a deadly process that cannot be reversed.<\/p>\n<p style=\"text-align: justify;\">You should then see the following prompt:<\/p>\n<div style=\"background: #f2f2f2; padding: 15px;\">\n<div><em><strong>Output<\/strong><\/em><\/div>\n<div>Enter passphrase (empty for no passphrase):<\/div>\n<\/div>\n<p style=\"text-align: justify;\">Here you optionally can enter a secure passphrase, highly recommended. A passphrase adds an extra security level to prevent unauthorised users from logging in.<\/p>\n<p style=\"text-align: justify;\">You will see the following output:<\/p>\n<div style=\"background: #f2f2f2; padding: 15px;\">\n<div><em><strong>Output<\/strong><\/em><\/div>\n<div>Your identification has been saved in \/<span style=\"color: #ff0000;\">your_home<\/span>\/.ssh\/id_rsa.<\/div>\n<div>Your public key has been saved in \/<span style=\"color: #ff0000;\">your_home<\/span>\/.ssh\/id_rsa.pub.<\/div>\n<div>The key fingerprint is:<\/div>\n<div>a9:49:2e:2a:5e:33:3e:a9:de:4e:77:11:58:b6:90:26 username@remote_host<\/div>\n<div>The key&#8217;s randomart image is:<\/div>\n<div>+&#8211;[ RSA 2048]&#8212;-+<\/div>\n<div>| ..o |<\/div>\n<div>| E o= . |<\/div>\n<div>| o. o |<\/div>\n<div>| .. |<\/div>\n<div>| ..S |<\/div>\n<div>| o o. |<\/div>\n<div>| =o.+. |<\/div>\n<div>|. =++.. |<\/div>\n<div>|o=++. |<\/div>\n<div>+&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<\/div>\n<\/div>\n<p style=\"text-align: justify;\">You currently have a public and private key that you can use to authenticate. Next, put the public key on your server so that you&#8217;ll be able to use SSH-key-based authentication to log in.<\/p>\n<h2>STEP 2 &#8211; Copy the Public Key to Ubuntu Server<\/h2>\n<p style=\"text-align: justify;\">The fastest way to copy your public key to the Ubuntu host is to use a utility named <em>ssh-copy-id<\/em>. This method is highly recommended due to its simplicity. If you don&#8217;t have <em>ssh-copy-id<\/em> available for you on your client machine, you can use one of the two alternative methods given in this section (manually copying the key or copying through password-based SSH).<\/p>\n<h3>Copying Public Key Using <em>ssh-copy-id<\/em><\/h3>\n<p style=\"text-align: justify;\">The <em>ssh-copy-id<\/em> tool is built-in by default in multiple operating systems so you can access it on your local system. For this method to work, you need password-based SSH access to your server.<\/p>\n<p style=\"text-align: justify;\">You simply need to define the remote host that you wish to connect as well as password-based SSH user account access to use the utility. Your public SSH key will be copied to this account.<\/p>\n<p>The syntax is:<\/p>\n<div style=\"background: #f2f2f2; padding: 15px;\">\n<div>ssh-copy-id <span style=\"color: #ff0000;\">username@remote_host<\/span><\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<p>You will see the following message:<\/p>\n<div style=\"background: #f2f2f2; padding: 15px;\">\n<div><em><strong>Output<\/strong><\/em><\/div>\n<div>The authenticity of host &#8216;<span style=\"color: #ff0000;\">203.0.113.1 <span style=\"color: #000000;\">(<\/span>203.0.113.1<span style=\"color: #000000;\">)<\/span><\/span>&#8216; can&#8217;t be established.<\/div>\n<div>ECDSA key fingerprint is fd:fd:d4:f9:77:fe:73:84:e1:55:00:ad:d6:6d:22:fe.<\/div>\n<div>Are you sure you want to continue connecting (yes\/no)? <span style=\"color: #ff0000;\">yes<\/span><\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\">After that, the utility will scan your local account for the <em>id_rsa.pub<\/em> key that we created previously. It will prompt you for the password of the remote user&#8217;s account after it finds the key.<\/p>\n<div style=\"background: #f2f2f2; padding: 15px;\">\n<div><em><strong>Output<\/strong><\/em><\/div>\n<div>\/usr\/bin\/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed<\/div>\n<div>\/usr\/bin\/ssh-copy-id: INFO: 1 key(s) remain to be installed &#8212; if you are prompted now it is to install the new keys<\/div>\n<div><span style=\"color: #ff0000;\">username<\/span>@<span style=\"color: #ff0000;\">203.0.113.1<\/span>&#8216;s password:<\/div>\n<\/div>\n<p style=\"text-align: justify;\">Type the password (password will not be displayed for security purposes) and hit <em>ENTER<\/em>. The utility will connect to the account on the remote host using the password you entered. Then it will copy the details of your <em>~\/.ssh\/id_rsa.pub<\/em> key into a file in the remote account&#8217;s home <em>~\/.ssh<\/em> directory named <em>authorized_keys<\/em>.<\/p>\n<p>You can see the following output:<\/p>\n<div style=\"background: #f2f2f2; padding: 15px;\">\n<div><em><strong>Output<\/strong><\/em><\/div>\n<div>Number of key(s) added: 1<\/div>\n<div>Now try logging into the machine, with: &#8220;ssh &#8216;<span style=\"color: #ff0000;\">username<span style=\"color: #000000;\">@<\/span>203.0.113.1<\/span>&#8216;&#8221; and check to make sure that only the key(s) you wanted were added.<\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\">At the same time, your <em>id_rsa.pub<\/em> key has been uploaded to the remote account. You can continue with <em><strong>STEP 3<\/strong><\/em>.<\/p>\n<h3>Copying Public Key Using SSH<\/h3>\n<p style=\"text-align: justify;\">If you don&#8217;t have <em>ssh-copy-id<\/em> ready, but you have password-based SSH access to an account on your server, you can upload your keys using a standard SSH method.<\/p>\n<p style=\"text-align: justify;\">We can do this through the <em>cat<\/em> command to read the contents of the public SSH key on our local machine and channeling that by using an SSH connection to the remote server.<\/p>\n<p style=\"text-align: justify;\">As well as, we can ensure that the <em>~\/.ssh<\/em> directory exists and needs the correct permissions under the account we\u2019re using.<\/p>\n<p style=\"text-align: justify;\">We can then output the content we channeled, ended into a file named <em>authorized_keys<\/em> within this directory. We\u2019ll use the <strong>&gt;&gt;<\/strong> redirect symbol to affix the content rather overwriting it. This will allow us to add keys without killing previously added keys.<\/p>\n<p>The command looks like this:<\/p>\n<div style=\"background: #f2f2f2; padding: 15px;\">\n<div>cat ~\/.ssh\/id_rsa.pub | ssh <span style=\"color: #ff0000;\">username<\/span>@<span style=\"color: #ff0000;\">remote_host<\/span> &#8220;mkdir -p ~\/.ssh &amp;&amp; touch ~\/.ssh\/authorized_keys &amp;&amp; chmod -R go= ~\/.ssh &amp;&amp; cat &gt;&gt; ~\/.ssh\/authorized_keys&#8221;<\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<p>You may get the following message:<\/p>\n<div style=\"background: #f2f2f2; padding: 15px;\">\n<div><em><strong>Output<\/strong><\/em><\/div>\n<div>The authenticity of host &#8216;<span style=\"color: #ff0000;\">203.0.113.1<\/span> (<span style=\"color: #ff0000;\">203.0.113.1<\/span>)&#8217; can&#8217;t be established.<\/div>\n<div>ECDSA key fingerprint is fd:fd:d4:f9:77:fe:73:84:e1:55:00:ad:d6:6d:22:fe.<\/div>\n<div>Are you sure you want to continue connecting (yes\/no)? <span style=\"color: #ff0000;\">yes<\/span><\/div>\n<\/div>\n<p style=\"text-align: justify;\">This means that your local computer does not identify the remote host. This can happen the first time you connect to a new host. Type &#8220;yes&#8221; and press <em>ENTER<\/em> to continue.<\/p>\n<p style=\"text-align: justify;\">Then, you will be prompted to enter the remote user account password:<\/p>\n<div style=\"background: #f2f2f2; padding: 15px;\">\n<div><em><strong>Output<\/strong><\/em><\/div>\n<div><span style=\"color: #ff0000;\">username<\/span>@<span style=\"color: #ff0000;\">203.0.113.1<\/span>&#8216;s password:<\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\">After entering your password, the details of your id_rsa.pub key will be copied at the end of the authorized_keys file of the remote user&#8217;s account. If it was successful, continue with <em><strong>STEP 3<\/strong><\/em>.<\/p>\n<h3>Copying Public Key Manually<\/h3>\n<p style=\"text-align: justify;\">You have to finish the above process manually, if you do not have password-based SSH access to your server accessible.<\/p>\n<p style=\"text-align: justify;\">We will manually affix the content of your <em>id_rsa.pub<\/em> file to the <em>~\/.ssh\/authorized_keys<\/em> file on your remote computer.<\/p>\n<p style=\"text-align: justify;\">To show the content of your <em>id_rsa.pub<\/em> key, type the following into your local machine:<\/p>\n<div style=\"background: #f2f2f2; padding: 15px;\">\n<div>cat ~\/.ssh\/id_rsa.pub<\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<p>You will see the key&#8217;s content, It looks something like this:<\/p>\n<div style=\"background: #f2f2f2; padding: 15px;\">\n<div><strong>Output<\/strong><\/div>\n<div>ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCqql6MzstZYh1TmWWv11q5O3pISj2ZFl9HgH1JLknLLx44+tXfJ7mIrKNxOOwxIxvcBF8PXSYvobFYEZjGIVCEAjrUzLiIxbyCoxVyle7Q+bqgZ8SeeM8wzytsY+dVGcBxF6N4JS+zVk5eMcV385gG3Y6ON3EG112n6d+SMXY0OEBIcO6x+PnUSGHrSgpBgX7Ks1r7xqFa7heJLLt2wWwkARptX7udSq05paBhcpB0pHtA1Rfz3K2B+ZVIpSDfki9UVKzT8JUmwW6NNzSgxUfQHGwnW7kj4jp4AT0VZk3ADw497M2G\/12N0PPB5CnhHf7ovgy6nL1ikrygTKRFmNZISvAcywB9GVqNAVE+ZHDSCuURNsAInVzgYo9xgJDW8wUw2o8U77+xiFxgI5QSZX3Iq7YLMgeksaO4rBJEa54k8m5wEiEE1nUhLuJ0X\/vh2xPff6SQ1BL\/zkOhvJCACK6Vb15mDOeCSq54Cr7kvS46itMosi\/uS66+PujOO+xt\/2FWYepz6ZlN70bRly57Q06J+ZJoc9FfBCbCyYH7U\/ASsmY095ywPsBo1XQ9PqhnN1\/YOorJ068foQDNVpm146mUpILVxmq41Cj55YKHEazXGsdBIbXWhcrRf4G2fJLRcGUr9q8\/lERo9oxRm5JFX6TCmj6kmiFqv+Ow9gI0x8GvaQ== demo@test<\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\">Access your remote host using that method you have available.<\/p>\n<p style=\"text-align: justify;\">Once you gain access to your account on the remote server, ensure the <em>~\/.ssh<\/em> directory exists. The following command will create the directory if required, or do nothing if it already exists:<\/p>\n<div style=\"background: #f2f2f2; padding: 15px;\">\n<div>mkdir -p ~\/.ssh<\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\">Now, you can create or edit the <em>authorized_keys<\/em> file within this directory. You also can add the contents of your id_rsa.pub file to the end of the <em>authorized_keys<\/em> file, creating it if required through this command:<\/p>\n<div style=\"background: #f2f2f2; padding: 15px;\">\n<div>echo <span style=\"color: #ff0000;\">public_key_string<\/span> &gt;&gt; ~\/.ssh\/authorized_keys<\/div>\n<\/div>\n<p style=\"text-align: justify;\">In the above command, replace the <span style=\"color: #ff0000;\">public_key_string<\/span> with the output from the <em>cat ~\/.ssh\/id_rsa.pub<\/em> command that you performed on your local machine. It should start with <em>ssh-rsa ABCD\u2026<\/em>.<\/p>\n<p style=\"text-align: justify;\">Finally, we will make sure that the <em>~\/.ssh<\/em> directory and <em>authorized_keys<\/em> file have the relevant permissions set:<\/p>\n<div style=\"background: #f2f2f2; padding: 15px;\">\n<div>chmod -R go= ~\/.ssh<\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\">This repeatedly removes all \u201cgroup\u201d and \u201cother\u201d permissions for the <em>~\/.ssh\/<\/em> directory.<\/p>\n<p style=\"text-align: justify;\">If you are using the <em>root<\/em> account to set up keys for a user account, it\u2019s also necessary that the <em>~\/.ssh<\/em> directory refers to the user and not to <em>root<\/em>:<\/p>\n<div style=\"background: #f2f2f2; padding: 15px;\">\n<div>chown -R <span style=\"color: #ff0000;\">alex<\/span>:<span style=\"color: #ff0000;\">alex<\/span> ~\/.ssh<\/div>\n<\/div>\n<p style=\"text-align: justify;\">In this guide, our user is named <span style=\"color: #ff0000;\">alex<\/span> but you have to replace the relevant username into the above command.<\/p>\n<h2>STEP 3 &#8211; Authenticate to Ubuntu Server Using SSH Keys<\/h2>\n<p style=\"text-align: justify;\">If you have successfully performed one of the procedures mentioned above, you don&#8217;t require the remote account&#8217;s password to log into the remote host.<\/p>\n<p>The basic process is the same:<\/p>\n<div style=\"background: #f2f2f2; padding: 15px;\">\n<div>ssh <span style=\"color: #ff0000;\">username<\/span>@<span style=\"color: #ff0000;\">remote_host<\/span><\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\">If this is your first time connecting to this host (if you did the last process mentioned above), you may look something like this:<\/p>\n<div style=\"background: #f2f2f2; padding: 15px;\">\n<div><em><strong>Output<\/strong><\/em><\/div>\n<div>The authenticity of host &#8216;<span style=\"color: #ff0000;\">203.0.113.1<\/span> (<span style=\"color: #ff0000;\">203.0.113.1<\/span>)&#8217; can&#8217;t be established.<\/div>\n<div>ECDSA key fingerprint is fd:fd:d4:f9:77:fe:73:84:e1:55:00:ad:d6:6d:22:fe.<\/div>\n<div>Are you sure you want to continue connecting (yes\/no)? <span style=\"color: #ff0000;\">yes<\/span><\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\">This means that your local machine does not identify the remote host. Type &#8220;yes&#8221; and then press the <em>ENTER<\/em> button to continue.<\/p>\n<p style=\"text-align: justify;\">If you didn&#8217;t provide a passphrase for your private key, you will be logged in instantly. If you provided a passphrase for the private key when you created the key, you will be prompted to enter it now. After validating, a new shell session will open for you with the configured account on the Ubuntu server.<\/p>\n<p style=\"text-align: justify;\">Note: Your keystrokes will not display in the terminal session for security purposes.<\/p>\n<p style=\"text-align: justify;\">If key-based authentication is performed successfully, continue on <em><strong>STEP 4<\/strong><\/em> to see how to more secure your system by disabling password authentication.<\/p>\n<h2>STEP 4 &#8211; Disable Password Authentication on your Server<\/h2>\n<p style=\"text-align: justify;\">If you are able to log into your account through SSH without a password, you have successfully configured SSH-key-based authentication to your account. But, your password-based authentication mechanism is still alive, indicating that your server is still exposed to brute-force attacks.<\/p>\n<p style=\"text-align: justify;\">Before executing the steps in this section, ensure that you either have SSH-key-based authentication configured for the root account or preferably, for a non-root account on this server with <em>sudo<\/em> privileges. This step will lock down password-based logins, so making sure that you will still be able to get administrative access is critical.<\/p>\n<p style=\"text-align: justify;\">When you have verified that your remote account has administrative rights, log in to your remote server through SSH keys, either as root or with an account with <em>sudo<\/em> privileges. Then, open up the SSH daemon&#8217;s configuration file:<\/p>\n<div style=\"background: #f2f2f2; padding: 15px;\">\n<div>sudo nano \/etc\/ssh\/sshd_config<\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\">Search for a directive named <em>PasswordAuthentication<\/em> inside the file. This might be commented out. Uncomment the line and set the value as &#8220;no&#8221;. This will disable your capability to log in through SSH using account passwords:<\/p>\n<div style=\"background: #f2f2f2; padding: 15px;\">\n<div style=\"text-align: center;\"><strong>\/etc\/ssh\/sshd_config<\/strong><\/div>\n<div>&#8230;<br \/>\nPasswordAuthentication no<br \/>\n&#8230;<\/div>\n<\/div>\n<p style=\"text-align: justify;\">Save and Close the file once you are completed by pressing <em>CTRL<\/em> + <em>X<\/em>, then enter <em>Y<\/em> to confirm saving the file and finally hit the <em>ENTER<\/em> button to exit nano. To execute these changes, we require restarting the <em>sshd<\/em> service:<\/p>\n<div style=\"background: #f2f2f2; padding: 15px;\">\n<div>sudo systemctl restart ssh<\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\">For safety, open up a new terminal window and check that the SSH service is working correctly before closing this session:<\/p>\n<div style=\"background: #f2f2f2; padding: 15px;\">\n<div>ssh <span style=\"color: #ff0000;\">username<\/span>@<span style=\"color: #ff0000;\">remote_host<\/span><\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\">Once you have verified your SSH service, you can safely close all current server sessions.<\/p>\n<p style=\"text-align: justify;\">The SSH daemon now only responds to SSH keys on your Ubuntu server. Password-based authentication has successfully been disabled.<\/p>\n<h3>Conclusion<\/h3>\n<p style=\"text-align: justify;\">You should now have configured SSH-key-based authentication on your server, which allows you to sign in without giving an account password.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction SSH (secure shell) is the encrypted protocol used to administer and interact with servers. You will spend maximum time in the terminal session connected to your server through SSH when working with an Ubuntu server. In this guide, you will learn how to set up SSH keys for Ubuntu 18.04 installation. SSH keys deliver [&hellip;]<\/p>\n","protected":false},"author":19,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[41,4],"tags":[926,910],"class_list":["post-6286","post","type-post","status-publish","format-standard","placeholder-for-hentry","category-howtos","category-web-hosting-faq","tag-ssh-keys","tag-ubuntu-18-04"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Set Up SSH Keys on Ubuntu 18.04<\/title>\n<meta name=\"description\" content=\"In this guide, you will learn how to set up SSH keys for Ubuntu 18.04 installation.\" \/>\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.milesweb.co.uk\/hosting-faqs\/how-to-set-up-ssh-keys-on-ubuntu-18-04\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Set Up SSH Keys on Ubuntu 18.04\" \/>\n<meta property=\"og:description\" content=\"In this guide, you will learn how to set up SSH keys for Ubuntu 18.04 installation.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-set-up-ssh-keys-on-ubuntu-18-04\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Hosting FAQs by MilesWeb\" \/>\n<meta property=\"article:published_time\" content=\"2019-07-25T10:55:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-08-02T10:59:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2019\/08\/How-to-Set-Up-SSH-Keys-on-Ubuntu-18.png\" \/>\n<meta name=\"author\" content=\"Ajit\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ajit\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-set-up-ssh-keys-on-ubuntu-18-04\/\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-set-up-ssh-keys-on-ubuntu-18-04\/\",\"name\":\"How to Set Up SSH Keys on Ubuntu 18.04\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-set-up-ssh-keys-on-ubuntu-18-04\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-set-up-ssh-keys-on-ubuntu-18-04\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2019\/08\/How-to-Set-Up-SSH-Keys-on-Ubuntu-18.png\",\"datePublished\":\"2019-07-25T10:55:05+00:00\",\"dateModified\":\"2019-08-02T10:59:24+00:00\",\"author\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/7cd39cafedd7652b49b849e5e331cd48\"},\"description\":\"In this guide, you will learn how to set up SSH keys for Ubuntu 18.04 installation.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-set-up-ssh-keys-on-ubuntu-18-04\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-set-up-ssh-keys-on-ubuntu-18-04\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-set-up-ssh-keys-on-ubuntu-18-04\/#primaryimage\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2019\/08\/How-to-Set-Up-SSH-Keys-on-Ubuntu-18.png\",\"contentUrl\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2019\/08\/How-to-Set-Up-SSH-Keys-on-Ubuntu-18.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-set-up-ssh-keys-on-ubuntu-18-04\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Set Up SSH Keys on Ubuntu 18.04\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/\",\"name\":\"Web Hosting FAQs by MilesWeb\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/7cd39cafedd7652b49b849e5e331cd48\",\"name\":\"Ajit\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/589d86e7a8ab32a9165a816c5a907b0d?s=96&d=blank&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/589d86e7a8ab32a9165a816c5a907b0d?s=96&d=blank&r=g\",\"caption\":\"Ajit\"},\"description\":\"With over 8+ years of experience in the digital marketing industry, I have achieved extensive exposure to result-oriented methodologies. And expertise in different domains like Datacentre Services, Cloud computing technology, Web hosting industry and many more.\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/author\/ajit\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Set Up SSH Keys on Ubuntu 18.04","description":"In this guide, you will learn how to set up SSH keys for Ubuntu 18.04 installation.","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.milesweb.co.uk\/hosting-faqs\/how-to-set-up-ssh-keys-on-ubuntu-18-04\/","og_locale":"en_GB","og_type":"article","og_title":"How to Set Up SSH Keys on Ubuntu 18.04","og_description":"In this guide, you will learn how to set up SSH keys for Ubuntu 18.04 installation.","og_url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-set-up-ssh-keys-on-ubuntu-18-04\/","og_site_name":"Web Hosting FAQs by MilesWeb","article_published_time":"2019-07-25T10:55:05+00:00","article_modified_time":"2019-08-02T10:59:24+00:00","og_image":[{"url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2019\/08\/How-to-Set-Up-SSH-Keys-on-Ubuntu-18.png","type":"","width":"","height":""}],"author":"Ajit","twitter_misc":{"Written by":"Ajit","Estimated reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-set-up-ssh-keys-on-ubuntu-18-04\/","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-set-up-ssh-keys-on-ubuntu-18-04\/","name":"How to Set Up SSH Keys on Ubuntu 18.04","isPartOf":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-set-up-ssh-keys-on-ubuntu-18-04\/#primaryimage"},"image":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-set-up-ssh-keys-on-ubuntu-18-04\/#primaryimage"},"thumbnailUrl":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2019\/08\/How-to-Set-Up-SSH-Keys-on-Ubuntu-18.png","datePublished":"2019-07-25T10:55:05+00:00","dateModified":"2019-08-02T10:59:24+00:00","author":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/7cd39cafedd7652b49b849e5e331cd48"},"description":"In this guide, you will learn how to set up SSH keys for Ubuntu 18.04 installation.","breadcrumb":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-set-up-ssh-keys-on-ubuntu-18-04\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-set-up-ssh-keys-on-ubuntu-18-04\/"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-set-up-ssh-keys-on-ubuntu-18-04\/#primaryimage","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2019\/08\/How-to-Set-Up-SSH-Keys-on-Ubuntu-18.png","contentUrl":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2019\/08\/How-to-Set-Up-SSH-Keys-on-Ubuntu-18.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/how-to-set-up-ssh-keys-on-ubuntu-18-04\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/"},{"@type":"ListItem","position":2,"name":"How to Set Up SSH Keys on Ubuntu 18.04"}]},{"@type":"WebSite","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/","name":"Web Hosting FAQs by MilesWeb","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Person","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/7cd39cafedd7652b49b849e5e331cd48","name":"Ajit","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/589d86e7a8ab32a9165a816c5a907b0d?s=96&d=blank&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/589d86e7a8ab32a9165a816c5a907b0d?s=96&d=blank&r=g","caption":"Ajit"},"description":"With over 8+ years of experience in the digital marketing industry, I have achieved extensive exposure to result-oriented methodologies. And expertise in different domains like Datacentre Services, Cloud computing technology, Web hosting industry and many more.","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/author\/ajit\/"}]}},"views":932,"_links":{"self":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts\/6286","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/users\/19"}],"replies":[{"embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/comments?post=6286"}],"version-history":[{"count":1,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts\/6286\/revisions"}],"predecessor-version":[{"id":6288,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts\/6286\/revisions\/6288"}],"wp:attachment":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/media?parent=6286"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/categories?post=6286"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/tags?post=6286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}