How to access your site’s php db using SSH key? #

  1. Select the site you want to connect using SSH.
  2. From the sidebar select “dev tools”
  3. In “Dev tools” select “Php My Admin”
  4. The 1st step is to download the key.
  5. After downloading the key, you need to set permission for your key. Use the command below to set permission.

    For Mac: 
    “chmod 600 (path-to-key)” 

    For example if your key is in downloads folder, the command would be like this,
    “chmod 600 /Users/tekyantra/Downloads/testfile.pem”

    For Windows:
    1. Reset permissionsicacls
    “C:\Path\To\Your\testfile.pem” /reset   2. Grant Read access to just the current user icacls
    “C:\Path\To\Your\testfile.pem” /grant:r “$($env:USERNAME):R”   

    3. Disable inheritance (removes other users)
    icacls “C:\Path\To\Your\testfile.pem” /inheritance:r
     

  6. If you were previously connected and forgot to disconnect, port 8888 may already be in use. Run this before connecting:

    For Mac: 
    lsof –ti :8888 | xargs kill –9″ 
     
    For Windows: 
    “netstat –ano | findstr :8888”
  7. Kill the process using that PID: For Mac:
    kill -9 1234For Windows:
    “taskkill /PID 1234 /F”

    (Replace 1234 with the actual number you found).

  8. After setting permission to the key use below command to connect to your site. 
    For Mac: 
    ssh -f -N -L 8888:127.0.0.1:80 –i (path-to-key) bitnami@1.1.1.1” 
     
    For Windows: 
    “ssh -N -L 8888:127.0.0.1:80 –i “C:\Path\To\Your\key.pem” bitnami@1.1.1.1” 
     
    Replace (path-to-key) and ip with your actual key path and ip 
  9. After connecting to your site, open the link below in your browser. 
    http://localhost:8888/phpmyadmin
  10. Use given credentials to login to your site’s database.
What are your feelings