I can rsync with drush but not `drush @remote status` I know it's not equivalent, but I can drush rsync @local @remote but not drush @remote status -v.  So my ssh keys are in place, I'm on the right port etc.

I get:

Loaded alias @remote from file /Volumes/Users/blah/.drush/aliases.drushrc.php
Begin redispatch via drush_invoke_process().
Calling proc_open(ssh -p 22009 BLAH@xxx.xxx.xxx.xxx 'env COLUMNS=238 drush  --verbose --root=/home/REMOTE/d7 --uri=d7.REMOTE.co.uk  core-status 2&gt;&amp;1' 2&gt;&amp;1);

env: drush: Permission denied


What do I need to set on @remote to make it work?  Drush is installed there (same version) and works happily.

Is there are Drush error log or will I need to get the hosting company to have a look through logs?

Here is my alias:

$aliases['REMOTE'] = array(
   'root' =&gt; '/home/REMOTE/SUBDIRECTORY',
   'uri' =&gt; 'http://REMOTE.co.uk',
   'remote-host' =&gt; 'xx.xx.xx.xx',
   'ssh-options' =&gt; '-p 22009',
   'remote-user' =&gt; 'SSH_USER',
   'path-aliases' =&gt;
   array (
      '%drush' =&gt; '/home/REMOTE/.composer/vendor/drush/drush',
      '%site' =&gt; 'sites/default/',
      '%dump-dir' =&gt; '/home/REMOTE/drush.dbdumps',
   ),
   'databases' =&gt;
   array (
      'default' =&gt;
      array (
         'default' =&gt;
         array (
            'database' =&gt; 'xxx',
            'username' =&gt; 'xxx',
            'password' =&gt; 'xxx',
            'host' =&gt; 'localhost',
            'port' =&gt; '',
            'driver' =&gt; 'mysql',
            'prefix' =&gt; '',
         ),
      ),
   ),
);
The first thing to do is to ensure that the 'remote-user' in your site alias is the same user that you use when you log in to the site.

The next thing to check is whether or not drush is on your $PATH on the remote site.  You have probably set this up explicitly in a .bashrc file, since it is working when you log in locally.  However, often, .bashrc files exit early when called in non-interactive mode, as Drush does.

Perhaps the easiest way to get around this is to figure out what the correct full path to the drush script is, and set '%drush-script' in the 'path-aliases' of your site alias to point at the correct executable.  See example.aliases.drushrc.php.

UPDATE: Use '%drush-script', not '%drush'.

'remote-user' is the user that Drush will use to log in via ssh. It should be a user that has permission to use Drush. Some people use the webserver user for this, but if you have a separate web admin user, that would be a preferable choice.