I'm trying to specify a port to SSH over in my drush site alias, but it doesn't appear to work as I would expect:

$aliases['example'] = array(
  'uri' => 'example.com',
  'root' => '/var/www/example/public',
  'remote-host' => 'example.com',
  'remote-user' => 'example_user',
  'remote-port' => '12345',
);

It appears this is not possible in version 3.3 of Drush?

Comments

q0rban’s picture

Actually, it appears that remote-port is in use, and refers to the mysql db port. This seems unintuitive.

From example.drushrc.php:

/**
 * - 'remote-port': If the database is remote and 'db-url' contains
 *     a tunneled port number, put the actual database port number
 *     used on the remote machine in the 'remote-port' setting.
 * - 'remote-host': The fully-qualified domain name of the remote system
 *     hosting the Drupal instance.  The remote-host option must be
 *     omitted for local sites, as this option controls whether or not
 *     rsync parameters are for local or remote machines.
 * - 'remote-user': The username to log in as when using ssh or rsync.
 */

Maybe we should make this remote-port and db-port:

greg.1.anderson’s picture

Category: feature » support
Status: Active » Fixed

Use ssh-options. This is documented in example.aliases.drushrc.php in drush-HEAD:

 * - 'ssh-options': If the target requires special options, such as a non-
 *     standard port, alternative identity file, or alternative
 *     authentication method, ssh- options can contain a string of extra
 *     options  that are used with the ssh command, eg "-p 100"

It's also in example.drushrc.php. Didn't check 3.x, though.

q0rban’s picture

Oh, ok, great! Thanks for the super quick response. :)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

anybody’s picture

Component: Code » Base system (internal API)
Issue summary: View changes

I ran into the same problem today (non-standard SSH port) and wrote a short blog post about it to help other drush users: http://julian.pustkuchen.com/node/721