SFTP for update manager uploading of themes in Drupal 7

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
gwhiz's picture

We are trying to understand how to use the Drupal7 update manager UI to install themes using the Appearance tab->install new theme box interface.

What is the flow of operation / modules when a URL is pasted into the admin UM UI dialogue?

We've got the admin UI up in a fresh Drupal7 install on a Gentoo/apache2/postgres/PHP 5.3.14+PDO webserver. The webserver is running SSHD with ssh working fine through the webserver's firewall. We are connecting to the admin update manager UI from a remote machine with Chrome, using Appearance->install new theme, pasting a URL from drupal.org for the new theme's zip file. The UI dialogue only gives FTP/port 21 options. Several places on drupal.org refers to using SFTP/port 22 instead.

If the above is not an option, can we download the zip file to the remote machine, then upload it to the webserver using the UI through an SFTP/port 22 connection somehow? If so how to configure drupal 7 on the webserver to accept it?

Thanks for any assistance!

Comments

junkerjp's picture

Hello,

I had a similar problem before and only the ftp option was showing up. Once I did the steps below it worked correctly.

If it's a linux machine (I'm using ubunutu server):

Check if the libraries are installed by typing
% php -m | grep ssh2

the output should be "ssh2"

If not, install the libraries
% sudo apt-get install php5-dev
% sudo apt-get install libssh2-1-dev
% sudo apt-get install libssh2-php

then restart Apache

danabel's picture

Thanks junkerjp! Worked a treat.

Maybe easier to do it in one line though :)

$ sudo apt-get install php5-dev libssh2-1-dev libssh2-php && sudo service apache2 restart

Hi, I've installed the SSH2

nicktr's picture

Hi,
I've installed the SSH2 php libraries as above, and now have SSH as an option in the update manager,
but it's still not accepting my username and password - is it because I have don't have https enabled yet?

This is what i'm getting:
http://cl.ly/image/0I0d0x1f3m1t

Thanks,

Nick

Notes for CentOS / RHEL

yesicanhackett's picture

Just ran into same issue on my CentOS 6 box...
Here's the info...

# su -
# php -m | grep ssh2
# rpm -qa | grep libssh2

 
If one or both queries are empty, then proceed with following...

# yum install libssh2 libssh2-devel
# pecl install ssh2
   *** Note you'll probably get a PECL error, if so then fix with...
   # pecl install "channel://pecl.php.net/ssh2-0.12"

 
Then enable the extension...

# echo "extension=ssh2.so" > /etc/php.d/ssh2.ini

 
Finally restart Apache

# /etc/init.d/httpd restart

 
When you next try to install a new theme, you should see the following message....

"Installing modules and themes requires access to your server via one of the following methods: FTP, SSH. "

 
Enjoy,
Hackett

Debian too

d.sibaud's picture

Same thing for debian, but there's no need to install the libssh2-devel, it's enough the libssh2 stable release.

Daniele Sibaud

Tourtools - Dritti al web
Tourtools website

_

shamio's picture

Is this process as same as uploading modules or uploading modules has a different structure? Both modules and themes are installing in drupalpatch/sites/.. and they should have the same structure. Is it true?

Doubt is the father of invention ... ZendegiyeSabz

SSH2 PHP libraries must be installed on the remote server

mlemus's picture

Danabel SSH2 php libraries install instructions works fine on Debian Squeeze. You need a valid username and password for SSH to work.

Mario Lemus

Debian Wheezy + dotdeb

Xigi's picture

For future seekers of answers:

I'm running Debian Wheezy with dotdeb.org php packages, only needed to install the php5-ssh2 package.

No success

Novato's picture

Hello.

I have SSH2 (checked with php -m), but I have only FTP method. The difference is that I'm using nginx. In any case, I had both methods until some days ago, after a system (debian stable) upgrade.

Regards

enable libssh2-php

liumwei's picture

If you use Ubuntu Linux for Drupal, just enable libssh2-php by the command line:

sudo apt-get install libssh2-php && sudo service apache2 restart

then goto "admin/reports/updates/update", you'll find the message:

Updating modules and themes requires access to your server via one of the following methods: FTP, SSH.

Now updating function by sftp is available。

Security

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week