function ssh_drush_command

8.0.x ssh.drush.inc ssh_drush_command()
6.x ssh.drush.inc ssh_drush_command()
7.x ssh.drush.inc ssh_drush_command()
5.x ssh.drush.inc ssh_drush_command()
master ssh.drush.inc ssh_drush_command()

File

commands/core/ssh.drush.inc, line 9
The drush site-ssh command for connecting to a remote alias' server via SSH, either for an interactive session or to run a shell command.

Code

function ssh_drush_command() {
  $items['site-ssh'] = array(
    'description' => 'Connect to a Drupal site\'s server via SSH for an interactive session or to run a shell command',
    'arguments' => array(
      'bash' => 'Bash to execute on target. Optional, except when site-alias is a list.',
    ),
    'options' => array(
      'cd' => "Directory to change to. Use a full path, TRUE for the site's Drupal root directory, or FALSE for the remote user's home directory. Defaults to the Drupal root.",
    ) + drush_shell_exec_proc_build_options(),
    'handle-remote-commands' => TRUE,
    'strict-option-handling' => TRUE,
    'examples' => array(
      'drush @mysite ssh' => 'Open an interactive shell on @mysite\'s server.',
      'drush @prod ssh \'ls /tmp\'' => 'Run "ls /tmp" on @prod site. If @prod is a site list, then ls will be executed on each site.',
      'drush @prod git pull' => 'Run "git pull" on the Drupal root directory on the @prod site.',
    ),
    'aliases' => array('ssh'),
    'bootstrap' => DRUSH_BOOTSTRAP_NONE,
    'topics' => array('docs-aliases'),
  );
  return $items;
}