Diagnosing drush sql-sync problem Broadly, I'm having problems running drush sql-sync so that I can get a local copy of my dev database. I was getting an "The external command could not be executed due to an application error ... code: 255)" type thing. 

To diagnose the problem more specifically, I ran drush @local sql-conf and got 

 Array
    (
        [driver] =&gt; mysql
        [database] =&gt; soa
        [username] =&gt; drupaluser
        [host] =&gt; 127.0.0.1
        [port] =&gt; 33066
    )


When I then ran drush @dev sql-conf I got 

Permission denied (publickey,password).


Running drush @dev sql-conf -s results in

Simulating backend invoke: ssh -o PasswordAuthentication=no git@dev.sub.mysite.com 'drush  --invoke --simulate --root=/var/www/dev --uri=http://default  sql-conf   --site=sub --env=dev 2&gt;&amp;1' 2&gt;&amp;1
Permission denied (publickey,password).


This means the issue isn't with Drush, it's that the server that matches up to your @dev alias doesn't have your SSH public key set up to allow you access. Either your public key hasn't been added to the ~/.ssh/authorized_keys file or the permissions on that file (or the ~/.ssh/ directory) have the wrong settings.