For each application, Cloud Platform creates a Unix user account called the site user. An application’s Drupal or PHP code runs as a site user, and all of the application’s environments, including the Development, Staging, and Production environments, use this same account.
To use SSH to sign in as the website user, you must first register SSH public keys for your Acquia user profile, which provides a more secure method of signing in than using a password alone. You can add as many SSH keys as you want, each with their own nicknames to help you track them.
Requirements
To use SSH to access your environment, you must meet the following requirements:
- Have the appropriate permission. This means you must be a member of a team assigned to the application, and have a role that has SSH access.
- Register an SSH public key in your Acquia profile, as described in Adding a public key to an Acquia profile.
Using SSH
When you connect to an environment with SSH, your PATH and other environment variables are configured exactly as they are for web processes, cron jobs, and Cloud hooks. In particular, whichever version of PHP you have configured will be the first in the PATH, and therefore will be the default in your SSH browser session.
To use SSH to access your environments, you can either use the ssh
command line application, or if you are a Windows user, you can use the PuTTY SSH client.
Windows users can use PuTTY (a free Telnet/SSH client) that provides a command-line access to your files.
To install and configure PuTTY on your computer, complete the following steps:
- Download PuTTY to your computer.
Start the application.
Note
When you run PuTTY, either enter the connection information for your infrastructure or load a browser session previously configured to connect to your web infrastructure, and click Open.
- Go to Category > Session, and in the Host Name (or IP address) field, enter the SSH address of the environment. For information about Cloud Platform environment infrastructure, including their SSH addresses, go to the Infrastructure page in the Cloud Platform user interface.
- Go to Category > Connection > SSH > Auth, and in the Private key file for authentication field, browse for the private SSH key file stored on your computer.
- Go to Category > Session, and in the Saved Sessions field, enter a descriptive name for the infrastructure connection.
- Click Save.
You can use the session you created to connect securely to Cloud Platform.
SSH and RSA key warnings
If you receive the following warning message when attempting to use your SSH key, it may indicate that your infrastructure has been relaunched:
WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!
For information about how to handle this warning message, see SSH and RSA key warnings after infrastructure relaunch.
Tasks you can perform from the command line
After you add your SSH key in Cloud Platform, you can use SSH in the Cloud Platform environment to perform the following tasks:
- Access your file storage directories from the command line
- Import and export databases
- Use the Drush command-line tool
Access your file storage directories from the command line
You have shell access to all web nodes running your application, using the same username and SSH public key credentials you use for rsync, Secure Copy (SCP), or Secure File Transfer Protocol (SFTP) on Cloud Platform. To access your file storage directories, use a command such as:
ssh [SSH address]
For example, this command accesses the Dev environment of an application named example
:
Import and export databases
Cloud Platform has unique database requirements to provide the best possible Drupal application performance. With SSH access enabled, you can use the Cloud Platform database import script. For more information, see Importing your database.
Use the Drush command-line tool
Cloud Platform applications with SSH access have an installed and configured infrastructure of Drush for performing administrative and application maintenance tasks from the command line instead of using the Drupal administrative interface. For more information, see About Drush on Cloud Platform.