drush site-ssh

Connect to a Drupal site's server via SSH for an interactive session or to run a shell command

Drush Command

drush site-ssh


bash : Bash to execute on target. Optional, except when site-alias is a list.


drush ssh


--cd : Directory to change to. Use a full path, TRUE for the site's Drupal root directory, or --no-cd for the ssh default (usually the remote user's home directory). Defaults to the Drupal root.
--ssh-options : A string of extra options that will be passed to the ssh command (e.g. "-p 100")
--tty : Create a tty (e.g. to run an interactive program).
--escaped : Command string already escaped; do not add additional quoting.


Open an interactive shell on @mysite's server.

drush @mysite ssh
Run "ls /tmp" on @prod site. If @prod is a site list, then ls will be executed on each site.
drush @prod ssh ls /tmp
Run "git pull" on the Drupal root directory on the @prod site.
drush @prod ssh git pull