How to add google reCAPTCHA to phpmyadmin login screen?
ya its good thinking to add google reCAPTCHA to phpmyadmin login page to make it secure. To add reCAPTCHA first make sure you have latest version of phpmyadmin installed as older version not support reCAPTCHA.
first signup for google recaptcha by visiting :: https://www.google.com/recaptcha/
add one of your website domain there and get sitekey and secret key , on that domain settings page goto bottom of page and click Advance Settings then you will see Domain Name Validation heading and with it you will see checkbox :: Verify the origin of reCAPTCHA solutions , so uncheck that checkbox and save settings.
so to upgrade phpmyadmin to latest version check :: https://answers.w3db.xyz/question/how-to-upgrade-phpmyadmin-to-latest-version/
once you have latest version of phpmyadmin or above 4.5 then login to ssh and edit
cd /usr/share/phpmyadmin/ nano /config.inc.php vim /config.inc.php # if nano is not installed try to edit with vim cp config.sample.inc.php config.inc.php # if no config.inc.php file is there then run it will create config.inc.php file then edit it with nano or vim
in config.inc.php file add these two lines somewhere top or bottom or middle or below $cfg[‘blowfish_secret’]
$cfg['CaptchaLoginPublicKey'] = 'paste here site key here you get from google in above step'; $cfg['CaptchaLoginPrivateKey'] = 'paste here secret key you get from google in above step ';
save it , and logout from phpmyadmin now you will see google recaptcha on login screen