diff --git a/commands/core/ssh.drush.inc b/commands/core/ssh.drush.inc
new file mode 100644
index 0000000..8466d7a
--- /dev/null
+++ b/commands/core/ssh.drush.inc
@@ -0,0 +1,110 @@
+<?php
+
+/**
+* @file
+*/
+
+function ssh_drush_command() {
+  $items['ssh'] = array(
+    'description' => 'Connect to a Drupal site\'s server via SSH',
+    'arguments' => array(
+      'site-alias [ cmd ... ]' => 'A remote site alias (command is optional), or a list of site aliases (requires a command)',
+    ),
+    'options' => array(
+      'ssh-options' => 'A string of extra options that will be passed to the ssh command (e.g. "-p 100")',
+    ),
+    'examples' => array(
+      'drush ssh @mysite' => 'Open an interactive shell on @mysite\'s server.',
+      'drush ssh @site1,@site2 ls /tmp' => 'Run "ls /tmp" on @site1\'s and @site2\'s server.',
+    ),
+    'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,
+  );
+  $items['site-connect'] = array(
+    'description' => 'Output an SSH command to connect to a Drupal site\'s server',
+    'arguments' => array(
+      'site-alias' => 'A remote site alias',
+    ),
+    'options' => array(
+      'ssh-options' => 'A string of extra options that will be passed to the ssh command (e.g. "-p 100")',
+    ),
+    'examples' => array(
+      'drush site-connect mysite' => 'Display an SSH command suitable for shell backticks to open an interactive shell on @mysite\'s server.',
+    ),
+    'bootstrap' => DRUSH_BOOTSTRAP_DRUSH,
+  );
+  return $items;
+}
+
+/**
+ * Command callback.
+ */
+function drush_ssh_ssh($alias) {
+  // If we were run with [ cmd ... ] arguments, load them into $command.
+  $args = func_get_args();
+  array_shift($args); // $alias
+  $command = implode(' ', $args);
+
+  $site = drush_sitealias_get_record($alias);
+
+  // If we have multiple sites, run ourselves on each one.
+  if (isset($site['site-list'])) {
+    if (empty($command)) {
+      drush_set_error(dt('A command is required when multiple site aliases are specified.'));
+      return;
+    }
+    foreach ($site['site-list'] as $alias) {
+      drush_ssh($alias, $command);
+    }
+    return;
+  }
+
+  // We only accept remote aliases.
+  if (empty($site['remote-host'])) {
+    drush_set_error(dt('@alias is not a remote alias.', array('@alias' => $alias)));
+    return;
+  }
+
+  // Build up the command and execute it.
+  $hostname = drush_escapeshellarg($site['remote-host'], "LOCAL");
+  $username = isset($site['remote-user']) ? drush_escapeshellarg($site['remote-user'], "LOCAL") . "@" : '';
+  $ssh_options = isset($site['ssh-options']) ? $site['ssh-options'] : drush_get_option('ssh-options', "-o PasswordAuthentication=no");
+
+  $cmd = array("ssh", $ssh_options, $username . $hostname);
+  if (!empty($command)) {
+    $cmd[] = escapeshellarg($command);
+  }
+  if (drush_get_context('DRUSH_VERBOSE') || drush_get_context('DRUSH_SIMULATE')) {
+    drush_print(implode(" ", $cmd));
+  }
+  if (!drush_get_context('DRUSH_SIMULATE')) {
+    if (extension_loaded('pcntl')) {
+      drush_shell_exec("which %s", array_shift($cmd));
+      $cmd_path = current(drush_shell_exec_output());
+      pcntl_exec($cmd_path, $cmd);
+    }
+    else {
+      proc_close(proc_open($cmd, array(0 => STDIN, 1 => STDOUT, 2 => STDERR), $pipes));
+    }
+  }
+}
+
+/**
+ * Command callback.
+ */
+function drush_ssh_site_connect($alias) {
+  $site = drush_sitealias_get_record($alias);
+
+  if (isset($site['site-list'])) {
+    drush_set_error(dt('site-connect only accepts an alias for a single site.'));
+    return;
+  }
+  if (empty($site['remote-host'])) {
+    drush_set_error(dt('@alias is not a remote alias.', array('@alias' => $alias)));
+    return;
+  }
+
+  $hostname = $site['remote-host'];
+  $username = isset($site['remote-user']) ? $site['remote-user'] . "@" : '';
+  $ssh_options = isset($site['ssh-options']) ? $site['ssh-options'] : drush_get_option('ssh-options', "-o PasswordAuthentication=no");
+  drush_print("ssh " . $ssh_options . " " . $username . $hostname);
+}
