{"id":40,"date":"2019-08-22T15:29:30","date_gmt":"2019-08-22T15:29:30","guid":{"rendered":"https:\/\/www.techcrm.in\/blogs\/?p=40"},"modified":"2020-09-08T14:55:48","modified_gmt":"2020-09-08T09:25:48","slug":"securing-phpmyadmin","status":"publish","type":"post","link":"https:\/\/www.techcrm.in\/blogs\/securing-phpmyadmin\/","title":{"rendered":"How to Secure phpMyAdmin"},"content":{"rendered":"\n<p> Like all applications and software that are popular, they expose points to exploit. &nbsp;You can add a layer of security to your phpMyAdmin installation to prevent any unwanted guests. <\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Securing with Pop Up Login<\/h4>\n\n\n\n<p><strong>Step 1: Edit Apache for .htaccess Overrides<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vim \/etc\/apache2\/conf-available\/phpmyadmin.conf<\/code><\/pre>\n\n\n\n<p> Insert the code below into the file between the &lt;Directory&gt; &lt;\/Directory&gt; tags. , afterward save and exit by typing&nbsp;:wq&nbsp;hitting&nbsp;Enter <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;Directory \/usr\/share\/phpmyadmin>\n  Options FollowSymLinks\n  DirectoryIndex index.php\n  AllowOverride All\n&lt;\/Directory><\/code><\/pre>\n\n\n\n<p><strong>Step 2: Create the .htaccess File<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/usr\/share\/phpmyadmin\/.htaccess<\/code><\/pre>\n\n\n\n<p> Paste in the code below: <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>AuthType Basic\nAuthName \"Restricted Files\"\nAuthUserFile \/etc\/phpmyadmin\/.htpasswd\nRequire valid-user<\/code><\/pre>\n\n\n\n<p><strong>Step 3: Create the .htpasswd File and Username<\/strong><\/p>\n\n\n\n<p> Pasting the code below conveniently makes a .htpasswd file while simultaneously creating a user. &nbsp;Replace the username in this example with the username of your choice. I\u2019m going to choose the username, tom, which we will use in&nbsp;<strong>Step 4<\/strong>. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo htpasswd -c \/etc\/phpmyadmin\/.htpasswd username<\/code><\/pre>\n\n\n\n<p> &nbsp;If we read this file we will find that it has added this user and has encrypted their password: <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>~# cat \/etc\/phpmyadmin\/.htpasswd\ntom:$apr1$fi4fis3.$oDVeDWxsp5eDhk.gc\/DT991<\/code><\/pre>\n\n\n\n<p><strong>Step 4: Verify Pop-Up Functionality<\/strong><\/p>\n\n\n\n<p> Visit&nbsp;http:\/\/yourhostname.com\/phpmyadmin\/&nbsp;(replacing yourhostname.com with your server\u2019s hostname or IP) to display a pop-up box where I will enter my username, tom, that I created in&nbsp;<strong>Step 3<\/strong>. <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"455\" height=\"188\" src=\"https:\/\/www.techcrm.in\/itb_blog\/wp-content\/uploads\/2019\/08\/authwindow.jpg\" alt=\"\" class=\"wp-image-42\"\/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">Securing by Changing URL to phpMyAdmin<\/h4>\n\n\n\n<p> Open the&nbsp;\/etc\/phpmyadmin\/apache.conf&nbsp;file: <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vim \/etc\/phpmyadmin\/apache.conf<\/code><\/pre>\n\n\n\n<p> Comment out the line<strong>Alias \/phpmyadmin \/usr\/share\/phpmyadmin<\/strong>&nbsp;with a # (as pictured below) and add in your the new URL you want to access your phpMyAdmin instance. <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#Alias \/phpmyadmin \/usr\/share\/phpmyadmin\nAlias \/mynewurl \/usr\/share\/phpmyadmin<\/code><\/pre>\n\n\n\n<p>Hit the\u00a0<strong>ESC<\/strong>\u00a0button and type\u00a0<strong>:wq<\/strong>\u00a0to save and quit.<\/p>\n\n\n\n<p>\n\nHope you find this blog post helpful.<\/p>\n\n\n\n<p>Feel free to add comments and queries, that helps us to improve the quality of posts.<\/p>\n\n\n\n<p>You can contact us at&nbsp;<a rel=\"noreferrer noopener\" href=\"mailto:contact@urdhva-tech.com\" target=\"_blank\">info@techcrm.in<\/a><\/p>\n\n\n\n<p>Thank you.\n\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Like all applications and software that are popular, they expose points to exploit. &nbsp;You can add a layer of security to your phpMyAdmin installation to prevent any unwanted guests. Securing with Pop Up Login Step 1: Edit Apache for .htaccess Overrides Insert the code below into the file between the &lt;Directory&gt; &lt;\/Directory&gt; tags. , afterward [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[6,89,2],"class_list":["post-40","post","type-post","status-publish","format-standard","hentry","category-ubuntu","tag-phpmyadmin","tag-secure","tag-ubuntu"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Secure phpMyAdmin - TechCRM<\/title>\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.techcrm.in\/blogs\/securing-phpmyadmin\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Secure phpMyAdmin - TechCRM\" \/>\n<meta property=\"og:description\" content=\"Like all applications and software that are popular, they expose points to exploit. &nbsp;You can add a layer of security to your phpMyAdmin installation to prevent any unwanted guests. Securing with Pop Up Login Step 1: Edit Apache for .htaccess Overrides Insert the code below into the file between the &lt;Directory&gt; &lt;\/Directory&gt; tags. , afterward [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.techcrm.in\/blogs\/securing-phpmyadmin\/\" \/>\n<meta property=\"og:site_name\" content=\"TechCRM\" \/>\n<meta property=\"article:published_time\" content=\"2019-08-22T15:29:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-09-08T09:25:48+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.techcrm.in\/itb_blog\/wp-content\/uploads\/2019\/08\/authwindow.jpg\" \/>\n<meta name=\"author\" content=\"Navin Rakhonde\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Navin Rakhonde\" \/>\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\":\"WebPage\",\"@id\":\"https:\/\/www.techcrm.in\/blogs\/securing-phpmyadmin\/\",\"url\":\"https:\/\/www.techcrm.in\/blogs\/securing-phpmyadmin\/\",\"name\":\"How to Secure phpMyAdmin - TechCRM\",\"isPartOf\":{\"@id\":\"https:\/\/www.techcrm.in\/blogs\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.techcrm.in\/blogs\/securing-phpmyadmin\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.techcrm.in\/blogs\/securing-phpmyadmin\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.techcrm.in\/itb_blog\/wp-content\/uploads\/2019\/08\/authwindow.jpg\",\"datePublished\":\"2019-08-22T15:29:30+00:00\",\"dateModified\":\"2020-09-08T09:25:48+00:00\",\"author\":{\"@id\":\"https:\/\/www.techcrm.in\/blogs\/#\/schema\/person\/992dfe427bb53dcdfd72dd80e3ef9dbc\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.techcrm.in\/blogs\/securing-phpmyadmin\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.techcrm.in\/blogs\/securing-phpmyadmin\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.techcrm.in\/blogs\/securing-phpmyadmin\/#primaryimage\",\"url\":\"https:\/\/www.techcrm.in\/itb_blog\/wp-content\/uploads\/2019\/08\/authwindow.jpg\",\"contentUrl\":\"https:\/\/www.techcrm.in\/itb_blog\/wp-content\/uploads\/2019\/08\/authwindow.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.techcrm.in\/blogs\/securing-phpmyadmin\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.techcrm.in\/blogs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Ubuntu\",\"item\":\"https:\/\/www.techcrm.in\/blogs\/category\/ubuntu\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"How to Secure phpMyAdmin\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.techcrm.in\/blogs\/#website\",\"url\":\"https:\/\/www.techcrm.in\/blogs\/\",\"name\":\"TechCRM\",\"description\":\"Blog\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.techcrm.in\/blogs\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.techcrm.in\/blogs\/#\/schema\/person\/992dfe427bb53dcdfd72dd80e3ef9dbc\",\"name\":\"Navin Rakhonde\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.techcrm.in\/blogs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/9cc8fd1b948255055b85e5d41dabfc6e704f806d180a1e21cb8fb378e2f5c022?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/9cc8fd1b948255055b85e5d41dabfc6e704f806d180a1e21cb8fb378e2f5c022?s=96&d=mm&r=g\",\"caption\":\"Navin Rakhonde\"},\"sameAs\":[\"https:\/\/www.techcrm.in\/\"],\"url\":\"https:\/\/www.techcrm.in\/blogs\/author\/navin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Secure phpMyAdmin - TechCRM","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.techcrm.in\/blogs\/securing-phpmyadmin\/","og_locale":"en_US","og_type":"article","og_title":"How to Secure phpMyAdmin - TechCRM","og_description":"Like all applications and software that are popular, they expose points to exploit. &nbsp;You can add a layer of security to your phpMyAdmin installation to prevent any unwanted guests. Securing with Pop Up Login Step 1: Edit Apache for .htaccess Overrides Insert the code below into the file between the &lt;Directory&gt; &lt;\/Directory&gt; tags. , afterward [&hellip;]","og_url":"https:\/\/www.techcrm.in\/blogs\/securing-phpmyadmin\/","og_site_name":"TechCRM","article_published_time":"2019-08-22T15:29:30+00:00","article_modified_time":"2020-09-08T09:25:48+00:00","og_image":[{"url":"https:\/\/www.techcrm.in\/itb_blog\/wp-content\/uploads\/2019\/08\/authwindow.jpg"}],"author":"Navin Rakhonde","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Navin Rakhonde","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.techcrm.in\/blogs\/securing-phpmyadmin\/","url":"https:\/\/www.techcrm.in\/blogs\/securing-phpmyadmin\/","name":"How to Secure phpMyAdmin - TechCRM","isPartOf":{"@id":"https:\/\/www.techcrm.in\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.techcrm.in\/blogs\/securing-phpmyadmin\/#primaryimage"},"image":{"@id":"https:\/\/www.techcrm.in\/blogs\/securing-phpmyadmin\/#primaryimage"},"thumbnailUrl":"https:\/\/www.techcrm.in\/itb_blog\/wp-content\/uploads\/2019\/08\/authwindow.jpg","datePublished":"2019-08-22T15:29:30+00:00","dateModified":"2020-09-08T09:25:48+00:00","author":{"@id":"https:\/\/www.techcrm.in\/blogs\/#\/schema\/person\/992dfe427bb53dcdfd72dd80e3ef9dbc"},"breadcrumb":{"@id":"https:\/\/www.techcrm.in\/blogs\/securing-phpmyadmin\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.techcrm.in\/blogs\/securing-phpmyadmin\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.techcrm.in\/blogs\/securing-phpmyadmin\/#primaryimage","url":"https:\/\/www.techcrm.in\/itb_blog\/wp-content\/uploads\/2019\/08\/authwindow.jpg","contentUrl":"https:\/\/www.techcrm.in\/itb_blog\/wp-content\/uploads\/2019\/08\/authwindow.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.techcrm.in\/blogs\/securing-phpmyadmin\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.techcrm.in\/blogs\/"},{"@type":"ListItem","position":2,"name":"Ubuntu","item":"https:\/\/www.techcrm.in\/blogs\/category\/ubuntu\/"},{"@type":"ListItem","position":3,"name":"How to Secure phpMyAdmin"}]},{"@type":"WebSite","@id":"https:\/\/www.techcrm.in\/blogs\/#website","url":"https:\/\/www.techcrm.in\/blogs\/","name":"TechCRM","description":"Blog","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.techcrm.in\/blogs\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.techcrm.in\/blogs\/#\/schema\/person\/992dfe427bb53dcdfd72dd80e3ef9dbc","name":"Navin Rakhonde","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.techcrm.in\/blogs\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/9cc8fd1b948255055b85e5d41dabfc6e704f806d180a1e21cb8fb378e2f5c022?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9cc8fd1b948255055b85e5d41dabfc6e704f806d180a1e21cb8fb378e2f5c022?s=96&d=mm&r=g","caption":"Navin Rakhonde"},"sameAs":["https:\/\/www.techcrm.in\/"],"url":"https:\/\/www.techcrm.in\/blogs\/author\/navin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.techcrm.in\/blogs\/wp-json\/wp\/v2\/posts\/40","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.techcrm.in\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techcrm.in\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techcrm.in\/blogs\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techcrm.in\/blogs\/wp-json\/wp\/v2\/comments?post=40"}],"version-history":[{"count":6,"href":"https:\/\/www.techcrm.in\/blogs\/wp-json\/wp\/v2\/posts\/40\/revisions"}],"predecessor-version":[{"id":353,"href":"https:\/\/www.techcrm.in\/blogs\/wp-json\/wp\/v2\/posts\/40\/revisions\/353"}],"wp:attachment":[{"href":"https:\/\/www.techcrm.in\/blogs\/wp-json\/wp\/v2\/media?parent=40"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techcrm.in\/blogs\/wp-json\/wp\/v2\/categories?post=40"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techcrm.in\/blogs\/wp-json\/wp\/v2\/tags?post=40"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}