Knowledge Base

How to access your account using SSH

This article describes how to connect to your A2 Hosting account securely using SSH.

What is SSH?

Secure Shell (SSH) is a protocol that provides secure command-line access to your A2 Hosting account. By using SSH, you can remotely log in to your A2 Hosting account and run commands as if you were sitting right at the server.

A2 Hosting does not support SSH's predecessor, telnet. Telnet traffic is not encrypted, and therefore is not secure.

Using an SSH client

Follow the appropriate procedure below for your computer's operating system.

Windows operating systems

Microsoft Windows does not include an SSH client, so you must download an SSH client first. A2 Hosting recommends PuTTY, a free program that you can download here. After you have downloaded the PuTTY executable to your local computer, you can use it to connect to your A2 Hosting account.

To connect to your account using PuTTY, follow these steps:

  1. Start PuTTY.
  2. In the Host Name (or IP address) text box, type username@example.com. Replace username with your A2 Hosting username, and example.com with your site's domain name.
  3. In the Port text box, type 7822.
    The default port for SSH is 22. However, A2 Hosting uses a different port for security reasons.
  4. Confirm that the Connection type radio button is set to SSH.
  5. Click Open.
  6. A PuTTY security alert about the server's host key appears the first time you connect. Click Yes.
  7. Type your account password and then press ENTER.
  8. When the remote server's command line prompt appears, you are connected. The initial command line prompt is:
    [email protected] [~]#
  9. You can now run commands. For example, to see a listing of the current directory, type ls and then press ENTER.
  10. To close the SSH connection when you are done, type exit and then press ENTER.
Mac OS X and Linux operating systems

Both Mac OS X and Linux include SSH clients, so connecting to your A2 Hosting account on these operating systems is easy. You do not have to download a special client.

To connect to your account, follow these steps:

  1. Open a terminal window. The procedure to do this depends on the operating system and desktop environment.
    • On Mac OS X, click Applications, click Utilities, and then click Terminal.
  2. At the command prompt, type the following command. Replace username with your A2 Hosting username, and example.com with your site's domain name:

    ssh -p 7822 username@example.com
    The default port for SSH is 22. However, A2 Hosting uses a different port for security reasons.
  3. Type your password when you are prompted to do so.
  4. When the remote server's command line prompt appears, you are connected. The initial command line prompt is:

    [email protected] [~]#
  5. You can now run commands. For example, to see a listing of the current directory, type ls and then press ENTER.
  6. To close the SSH connection when you are done, type exit and then press ENTER.

    In the command in step 2, we explicitly specify the port number, the username, and the hostname. However, you can also define these settings for a remote host in your ~/.ssh/config file as follows:

    Host example
        Hostname example.com
        Port 7822
        User username
    

    The Host value can be any name you want; it is simply a label for the other settings. The Hostname value is the remote host you want to access, the port number is 7822, and the User value specifies your A2 Hosting account username. With this configuration defined, you can connect to the account by simply using the Host value. You do not have to type the port number, username, and hostname each time. The following command demonstrates how to do this:

    ssh example

More Information

For more information about SSH, please visit http://en.wikipedia.org/wiki/Secure_Shell.