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.

SSH is only available with Linux hosting packages. Windows SSH clients can be used to access Linux servers.
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

Windows 10

Recent updates of Windows 10 include the Windows Subsystem for Linux (WSL) which provides a convenient way to run Linux commands. Installation instructions for the WSL are available here. Once the WSL is installed, you can connect to your account with SSH by following these steps:

  1. Open the Run dialog box by pressing the Windows key + r.
  2. In the Run dialog box type bash and then click OK to to start the bash shell.
  3. Type the following command at the command line. Replace username with your A2 Hosting username, and replace example.com with your site's domain name:
    ssh -p 7822 username@example.com
  4. Type your password when you are prompted to do so and then press Enter.
  5. When the remote server's command line prompt appears, you are connected. The initial command line prompt is:

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

Other Windows versions

Older versions of Microsoft Windows do 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

What SSH is and why you should consider using it

SSH is an acronym for Secure Shell. SSH allows a user to log in to a computer located around the globe, as long as it is running an SSH server. With your web hosting account, SSH gives you the ability to access your A2 Hosting account. It is an excellent method for managing your A2 Hosting solution from the command line. With its simplified interface, the command line allows you to perform tasks with text commands. You'll also find that SSH is a time-saving solution that can ultimately help speed up many tasks. You can also do tasks that you cannot do with your account's included hosting control panel.

Thanks in part to being able to offer strong encryption, SSH provides a more secure login option compared to file transfer methods like FTP and unencrypted protocols like telnet.

While this all may sound complicated, an SSH connection is really as simple as creating a secure connection between two computers. Our step-by-step SSH account access instructions, outlined above, will help you access your account remotely. It is as if you were right in front of your server, in the data center where it is located.

How SSH works

SSH is a way to login remotely via one computer to another computer securely. It protects the data that is sent between a client and a server over a network, usually the internet. Verification is required when a client makes the connection to their server. This is often referred to as a “handshake” and is created by exchanging cryptographic keys. This ensures that the transaction is secure. Again, this may sound complicated, but this is the same as logging into a computer as if you were sitting in front of it. The only difference is that you are doing it remotely. The security protocols help ensure that nobody else gains access to your valuable information.

Once a server is able to authenticate the connecting client, a tunneled connection is created. SSH is able to provide a safe, encrypted connection between the client and the server through this encrypted tunnel. From here, you can easily transfer files between the connected machines. You can also run programs and commands that would otherwise require more complicated screen sharing solutions.

What you need to create an SSH connection

A2 Hosting gives you just about everything you need, including step-by-step instructions, to connect to your account using SSH. Just as you need an FTP client to manage files with FTP, you need to install an SSH client on your computer to make an SSH connection. Putty and WinSCP are popular SSH solutions for Windows users. OpenSSH is an excellent alternative for Linux and Mac users to make remote, secure connections to a server.