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
- Access SSH from your cpanel home page
- Generate a new key ( Leave key name as default ex: id_rsa , choose a password as per your choice)
- Authorize this inside ‘Public Keys’
- 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 .
- Download it from http://www.putty.org/
- Install putty then open it
- Enter host name ex: domainname.com
- Import .ppk file inside Connection->SSH->Auth section on putty left side window
- Now click ‘Open’
- There inside putty window ,enter username of your server ex: myweb
- Then it ask for passphrase for key ….
There enter key password that you mentioned while generating key on cpanel
- Now for magento ,we have to access ‘bin’ folder
- So type there cd public_html/bin (you can also check what else folder inside it via command : dir)
- Now we are in our magento bin folder
Here we can execute all magento commands ex:
php -f magento cache:flush