Developers are not allowed to have direct access to the Production Drupal servers, which are Linux. But, I need for developers to be able to run a limited set of Drush commands via remote site aliases.

I have this working by using Drush remote aliases and Drush policies. The Drush example docs don't go into much detail, but show www-data in one of the examples.

 * @code
 * $aliases['live'] = array(
 *   'remote-host' => 'server.domain.com',
 *   'remote-user' => 'www-admin',
 *   'root' => '/other/path/to/drupal',
 *   'uri' => 'http://example.com',
 * );

But, this can't be, can it? Yes, that's the "user" Apache runs as, but this user is a dummy account with no login or password credentials, or user directory, so no ssh keys.

How do you setup an account for use with the remote site aliases, or how did you modify the Apache user / process to use login credentials or ssh keys?

1 Answer 1


You may be looking at old docs, as that is a PHP array, and newer versions of Drush use .yml.

That said, you can set set up an SSH key on your server, then set up a user in your .ssh/config file as follows:

Host someidentifier
HostName example.com
Port 2233
User RemoteUsername
IdentityFile ~/.ssh/id_rsa

Test this works by running ssh someidentifier. After doing this, you can set the remote-user key for the Drush alias to be someidentifier, and your alias will work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.