{"id":259,"date":"2021-05-12T07:40:55","date_gmt":"2021-05-12T07:40:55","guid":{"rendered":"https:\/\/takeondevops.com\/?p=259"},"modified":"2021-05-19T12:11:47","modified_gmt":"2021-05-19T12:11:47","slug":"lets-encrypt","status":"publish","type":"post","link":"https:\/\/takeondevops.com\/?p=259","title":{"rendered":"Getting a free Let&#8217;s encrypt TLS certificate for your site"},"content":{"rendered":"\n<p>There are many ways of getting a free Let&#8217;s encrypt certificate. You can find them easily in here: <a href=\"https:\/\/letsencrypt.org\/getting-started\/\">Getting Started &#8211; Let&#8217;s Encrypt (letsencrypt.org)<\/a>. There are 2 main ways to get this certificate as per the above link. Namely, generating the certificate with SSH and without SSH. <\/p>\n\n\n\n<p>Here, the method that involves SSH requires that you have root access. But I was able to find another way that works without root access. This blog that I am writing is based on that method. <\/p>\n\n\n\n<p>Let us begin. First, login to your webserver using ssh. At this point, if you have not already enabled ssh, then you will need to enable it. (at least temporarily)<\/p>\n\n\n\n<p>Now, from your home directory type in the following. This command will download the scripts needed to generate the certificates.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl https:\/\/get.acme.sh | sh<\/code><\/pre>\n\n\n\n<p>Next, you will see that you have a new hidden directory called .acme.sh. The scripts needed to generate the certificate is under this directory. At this point, the previous command should have executed successfully and the .acme.sh directory should be created. (You may verify this by typing ls -la from the current working directory.<\/p>\n\n\n\n<p>Lastly, we just need to generate the certificate with the help of the script we just downloaded. Execute the following.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.acme.sh\/acme.sh --issue -d &lt;Your Domain name&gt; -w &lt;Website directory&gt;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>Example:\n.acme.sh\/acme.sh --issue -d takeondevops.com -w \/var\/www\/html<\/code><\/pre>\n\n\n\n<p>After executing the script, your .acme folder should look like this.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.acme.sh\/takeondevops.com:\ntotal 32\n-rw-rw-r-- 1 takegpbw takegpbw 3751 May 10 10:32 ca.cer\n-rw-rw-r-- 1 takegpbw takegpbw 5597 May 10 10:32 fullchain.cer\n-rw-rw-r-- 1 takegpbw takegpbw 1846 May 10 10:32 takeondevops.com.cer\n-rw-rw-r-- 1 takegpbw takegpbw  636 May 10 10:32 takeondevops.com.conf\n-rw-rw-r-- 1 takegpbw takegpbw  980 May 10 10:32 takeondevops.com.csr\n-rw-rw-r-- 1 takegpbw takegpbw  211 May 10 10:32 takeondevops.com.csr.conf\n-rw-rw-r-- 1 takegpbw takegpbw 1679 May 10 10:32 takeondevops.com.key\n<\/code><\/pre>\n\n\n\n<p>And that is it. Use a FTP client\/ SCP client like WinSCP to copy the .cer file (this is your certificate) and the .key file. Alternatively, you  can just cat the file and copy the content &#8211; for both the certificate and the key. <\/p>\n\n\n\n<p>Optional: If you intended to enable SSH to your webserver temporarily, then now you can disable it.<\/p>\n\n\n\n<p>Stay tuned for more interesting blogs. I hope to add a blog on SSL redirects as well. Check out my featured posts <a href=\"https:\/\/takeondevops.com\/?cat=4\" target=\"_blank\" rel=\"noreferrer noopener\">here.<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">PS: These certificates are only valid for 3 months. After which they will expire. Therefore, you will have to repeat this process later on.<\/h3>\n","protected":false},"excerpt":{"rendered":"<p>There are many ways of getting a free Let&#8217;s encrypt certificate. You can find them easily in here: Getting Started &#8211; Let&#8217;s Encrypt (letsencrypt.org). There are 2 main ways to get this certificate as per the above link. Namely, generating the certificate with SSH and without SSH. Here, the method that involves SSH requires that [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","footnotes":""},"categories":[3,5,6,1],"tags":[],"class_list":["post-259","post","type-post","status-publish","format-standard","hentry","category-dev","category-infosec","category-network","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Getting a free Let&#039;s encrypt TLS certificate for your site - Take On Devops<\/title>\n<meta name=\"description\" content=\"In this blog post we will be looking at how we can generate a free Let&#039;s encrypt SSL certificate using SSH (without root 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:\/\/takeondevops.com\/?p=259\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Getting a free Let&#039;s encrypt TLS certificate for your site - Take On Devops\" \/>\n<meta property=\"og:description\" content=\"In this blog post we will be looking at how we can generate a free Let&#039;s encrypt SSL certificate using SSH (without root access.)\" \/>\n<meta property=\"og:url\" content=\"https:\/\/takeondevops.com\/?p=259\" \/>\n<meta property=\"og:site_name\" content=\"Take On Devops\" \/>\n<meta property=\"article:published_time\" content=\"2021-05-12T07:40:55+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-05-19T12:11:47+00:00\" \/>\n<meta name=\"author\" content=\"ihsan izwer\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"ihsan izwer\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/takeondevops.com\\\/?p=259#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/takeondevops.com\\\/?p=259\"},\"author\":{\"name\":\"ihsan izwer\",\"@id\":\"https:\\\/\\\/takeondevops.com\\\/#\\\/schema\\\/person\\\/465f2fb632235eb4079002754cd66aeb\"},\"headline\":\"Getting a free Let&#8217;s encrypt TLS certificate for your site\",\"datePublished\":\"2021-05-12T07:40:55+00:00\",\"dateModified\":\"2021-05-19T12:11:47+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/takeondevops.com\\\/?p=259\"},\"wordCount\":337,\"commentCount\":0,\"articleSection\":[\"Dev\",\"InfoSec\",\"Network\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/takeondevops.com\\\/?p=259#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/takeondevops.com\\\/?p=259\",\"url\":\"https:\\\/\\\/takeondevops.com\\\/?p=259\",\"name\":\"Getting a free Let's encrypt TLS certificate for your site - Take On Devops\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/takeondevops.com\\\/#website\"},\"datePublished\":\"2021-05-12T07:40:55+00:00\",\"dateModified\":\"2021-05-19T12:11:47+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/takeondevops.com\\\/#\\\/schema\\\/person\\\/465f2fb632235eb4079002754cd66aeb\"},\"description\":\"In this blog post we will be looking at how we can generate a free Let's encrypt SSL certificate using SSH (without root access.)\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/takeondevops.com\\\/?p=259#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/takeondevops.com\\\/?p=259\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/takeondevops.com\\\/?p=259#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/takeondevops.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Getting a free Let&#8217;s encrypt TLS certificate for your site\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/takeondevops.com\\\/#website\",\"url\":\"https:\\\/\\\/takeondevops.com\\\/\",\"name\":\"Take On Devops\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/takeondevops.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/takeondevops.com\\\/#\\\/schema\\\/person\\\/465f2fb632235eb4079002754cd66aeb\",\"name\":\"ihsan izwer\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c82c3d13c92d77259746074978cb7d498778b44914dea60ad0367dec237c349f?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c82c3d13c92d77259746074978cb7d498778b44914dea60ad0367dec237c349f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c82c3d13c92d77259746074978cb7d498778b44914dea60ad0367dec237c349f?s=96&d=mm&r=g\",\"caption\":\"ihsan izwer\"},\"url\":\"https:\\\/\\\/takeondevops.com\\\/?author=3\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Getting a free Let's encrypt TLS certificate for your site - Take On Devops","description":"In this blog post we will be looking at how we can generate a free Let's encrypt SSL certificate using SSH (without root 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:\/\/takeondevops.com\/?p=259","og_locale":"en_US","og_type":"article","og_title":"Getting a free Let's encrypt TLS certificate for your site - Take On Devops","og_description":"In this blog post we will be looking at how we can generate a free Let's encrypt SSL certificate using SSH (without root access.)","og_url":"https:\/\/takeondevops.com\/?p=259","og_site_name":"Take On Devops","article_published_time":"2021-05-12T07:40:55+00:00","article_modified_time":"2021-05-19T12:11:47+00:00","author":"ihsan izwer","twitter_card":"summary_large_image","twitter_misc":{"Written by":"ihsan izwer","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/takeondevops.com\/?p=259#article","isPartOf":{"@id":"https:\/\/takeondevops.com\/?p=259"},"author":{"name":"ihsan izwer","@id":"https:\/\/takeondevops.com\/#\/schema\/person\/465f2fb632235eb4079002754cd66aeb"},"headline":"Getting a free Let&#8217;s encrypt TLS certificate for your site","datePublished":"2021-05-12T07:40:55+00:00","dateModified":"2021-05-19T12:11:47+00:00","mainEntityOfPage":{"@id":"https:\/\/takeondevops.com\/?p=259"},"wordCount":337,"commentCount":0,"articleSection":["Dev","InfoSec","Network"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/takeondevops.com\/?p=259#respond"]}]},{"@type":"WebPage","@id":"https:\/\/takeondevops.com\/?p=259","url":"https:\/\/takeondevops.com\/?p=259","name":"Getting a free Let's encrypt TLS certificate for your site - Take On Devops","isPartOf":{"@id":"https:\/\/takeondevops.com\/#website"},"datePublished":"2021-05-12T07:40:55+00:00","dateModified":"2021-05-19T12:11:47+00:00","author":{"@id":"https:\/\/takeondevops.com\/#\/schema\/person\/465f2fb632235eb4079002754cd66aeb"},"description":"In this blog post we will be looking at how we can generate a free Let's encrypt SSL certificate using SSH (without root access.)","breadcrumb":{"@id":"https:\/\/takeondevops.com\/?p=259#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/takeondevops.com\/?p=259"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/takeondevops.com\/?p=259#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/takeondevops.com\/"},{"@type":"ListItem","position":2,"name":"Getting a free Let&#8217;s encrypt TLS certificate for your site"}]},{"@type":"WebSite","@id":"https:\/\/takeondevops.com\/#website","url":"https:\/\/takeondevops.com\/","name":"Take On Devops","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/takeondevops.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/takeondevops.com\/#\/schema\/person\/465f2fb632235eb4079002754cd66aeb","name":"ihsan izwer","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/c82c3d13c92d77259746074978cb7d498778b44914dea60ad0367dec237c349f?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/c82c3d13c92d77259746074978cb7d498778b44914dea60ad0367dec237c349f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c82c3d13c92d77259746074978cb7d498778b44914dea60ad0367dec237c349f?s=96&d=mm&r=g","caption":"ihsan izwer"},"url":"https:\/\/takeondevops.com\/?author=3"}]}},"jetpack_featured_media_url":"","amp_enabled":true,"_links":{"self":[{"href":"https:\/\/takeondevops.com\/index.php?rest_route=\/wp\/v2\/posts\/259","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/takeondevops.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/takeondevops.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/takeondevops.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/takeondevops.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=259"}],"version-history":[{"count":2,"href":"https:\/\/takeondevops.com\/index.php?rest_route=\/wp\/v2\/posts\/259\/revisions"}],"predecessor-version":[{"id":268,"href":"https:\/\/takeondevops.com\/index.php?rest_route=\/wp\/v2\/posts\/259\/revisions\/268"}],"wp:attachment":[{"href":"https:\/\/takeondevops.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=259"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/takeondevops.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=259"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/takeondevops.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=259"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}