You can do it via SSH as you can do it via FTP also.
If you have your installation as me: home/user/www/website.com/ (magento install here)
While in production:
Set to 777 folder website.com (folder only)
Go to /downloader Set 777 to folder and enlosed items
Go to /media Set 777 to folder and enclosed items
Go to /var set 777 to folder and enclosed items
That\’s all you need to set to 777. The error at this point disappears.
If you having the error during installation:
Your Magento folder does not have sufficient write permissions, which downloader requires. (recheck downloader folder permission or restart server)
Magento Connect 2.0 - Connection Error try again later [when installing with the Extension Key]
Solution that fixed this error is to intall PHP-XML (that was missing)
Install php-xml rpm package:
# yum --enablerepo=remi install php-xml
If you run another repo, find your PHP-XML version.
My extension is now installed. Enjoy.
PS: Don\’t forget to run magento-cleanup.php to set back securely your folder & files permissions