Connecting to CodeGuard ( SFTP cPanel )

CodeGuard will now auto-detect & add your WordPress database for you if you connect via SFTP!

Setting up your Server & Generating a Key Pair

1.) Generate a Public/Private Key pair

  • On Windows open up Powershell, on MacOS & Linux open up Terminal & type in the following command and hit enter.

ssh-keygen -t rsa

  • You can continue hitting enter untill the process is finished.

2.) Open up both the Public & Private Keys you generated in a text editor of your choice.

3.) Log into cPanel & do a search for ‘SSH’

3.) Copy & Paste your Public Key & click Import ( )

4.) Add CodeGuard IP addresses to Remote MySQL

  • While we are in cPanel you also need to add CodeGuards IP addresses to Remote MySQL so their servers can access your Database






Connecting to CodeGuard

1.) Log into your CodeGuard Dashboard
2.) Scroll down & Click on the “Add FTP/SFTP Website” button
3.) Enter your WordPress Site URL
4.) Make sure SFTP is selected
5.) Enter your cPanel UserName & Password
6.) Copy & Paste your Private Key into CodeGuard ( id_rsa )

  • by clicking the ‘Upload a Private key you have generated’ link

7.) Click the “Test Website” button

Capture Your Code

  • IMPORTANT - In order for CG to automatically detect and add your database you will need to make sure that you select the Absolute Root Directory of your WordPress Installation which is usually “public_html”, however, if you have more than one WP installation under public_html then select the WordPress Site’s folder instead eg. /public_html/wpsite/…

1.) Make sure that the Root Directory of your WordPress Installation is selected
2.) Click the “Select Root Directory” button
3.) In the next Box you can check the same folder again
4.) Click the “Begin First Backup” button.

Your WordPress Database should automatically be picked up and added to your CG Dashboard. If it hasn’t been then you did not select the correct Root Directory in the previous steps.

CAVEAT - If Public & Private Key isn’t working

1.) Open cPanel > Filemanager & double check that the Public Key was placed in the correct spot by cPanel

  • You should be above your public_html folder.
  • If you don’t see a folder named .ssh, check your cPanel settings to show hidden dotfiles. ( upper right hand corner gear icon )
  • If the .ssh folder doesn’t exist go ahead and create one ( DOT—> .ssh )
  • then create a file inside called authorized_keys
  • Paste your Public Key inside there & save