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

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

What Is SSH & Why You Should Consider Using It?

SSH is an acronym for for Secure Shell. SSH essentially allows a user to log into a computer located around the globe as long as it running an SSH server. In regards to 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 with Linux 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 and allow you to perform those that you are unable to with your account's included hosting control panel

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

While this 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 essentially as if you were right in front of your server, within the data center where it is located.

How Does SSH Work?

SSH is a way to remote login via one computer to another computer securely. It protects the data that is sent between a client and a server over a network, most likely the internet. Verification is required when a client makes the connection to their server. Many times this is referred to as “handshake” and is often created by exchanging cryptographic keys. This is to ensure that the transaction is secured. 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 in this instance. The security protocols are required to ensure not just anyone is gaining access to your valuable information.

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

What You Will Need To Create An SSH Connection

A2 Hosting gives you just about everything you will need, including step by step instructions, in order to connect to your account via SSH. Just as you would need an FTP client to manage files with that, you would need to an install an SSH solution on your computer to make an SSH connection. Putty and WinSCP are both popular SSH solutions that can be used by Windows users. OpenSSH is an excellent alternative for both Linux and Mac users to make secure connections to a server.