I have public and private ssh keys on all of my three servers (dev, UAT, & production) so I can log in remotely, or from one to another. Everything is working perfectly for the ssh
and scp
commands.
It does not work, however, for Drush. If I execute drush @dev status
from UAT, for example, I get the server's banner saying the system is "to be used by authorized users only blah blah blah", and then I get
Permission denied (publickey,password,keyboard-interactive).
My ~/.drush/aliases.drushrc.php
file contains:
# Development #
$aliases['dev'] = array(
'uri' => 'http://default',
'root' => '/var/www/vhosts/dev.www.company.com/current/',
'remote-host' => 'companya0.company.com',
'remote-user' => 'myusername'
);
# UAT #
$aliases['uat'] = array(
'uri' => 'http://default',
'root' => '/var/www/vhosts/uat.www.company.com/current/',
'remote-host' => 'companyc6.company.com',
'remote-user' => 'myusername'
);
# Production #
$aliases['prod'] = array(
'uri' => 'http://default',
'root' => '/var/www/vhosts/www.company.com/current/',
'remote-host' => 'companyc1.company.com',
'remote-user' => 'myusername'
);
ONLY Drush has any problem using my ssh keys. What could be preventing it from working?
www-data
(for example), then your SSH keys may be wrong/disallowed/non-whitelisted.sudo
beforedrush
and it appears everything is running as root (a security hole I've alerted the sysadmin about). It appears that this is the problem. I'm currently looking for a solution while I wait for the sysadmin...