Configure SSH on cpanel and connect via putty to execute Magento command line on live server


When our Magento 2 on live server and we require to enable disable modules, flush cache , deploy static files etc ,we need to configure SSH .
Below tutorials guide you how to setup SSH and connect server via SSH client (putty)

Configure SSH on cpanel

  1. Access SSH from your cpanel home page


  2. Generate a new key ( Leave key name as default ex: id_rsa , choose a password as per your choice)
  3. Authorize this inside ‘Public Keys’
  4. Download Private key (enter key password on passphrase )
    This ‘.ppk ‘ file will have to import on ssh client i.e putty

Connecting to server via SSH client ex: putty

There a famous ssh client i.e putty. we will be using putty .

  1. Download it from
  2. Install putty then open it
  3. Enter host name ex:


  4. Import .ppk file inside Connection->SSH->Auth section on putty left side window


  5. Now click ‘Open’
  6. There inside putty window ,enter username of your server ex: myweb
  7. Then it ask for passphrase for key ….
    There enter key password that you mentioned while generating key on cpanel
  8. Now for magento ,we have to access ‘bin’ folder
  9. So type there cd public_html/bin (you can also check what else folder inside it via command : dir)
  10. Now we are in our magento bin folder
    Here we can execute all magento commands ex:

    php -f magento cache:flush


  • Jhon Toscano Abia

    Muchas gracias, todo me funciono correctamente. Saludos desde PerĂº.