a2hosting ssh

How to use SSH (Secure Shell) on Windows and Mac to access your account

Where can you find SSH connection details?

To find this information, please first log in to the A2 Hosting Customer Portal. It can be found at:

https://my.a2hosting.com/

How to use an SSH client

Windows operating systems

SSH client can be used, but for the purposes of this demonstration, we will be using PuTTY, which you can download here. To connect to your account using PuTTY, follow these steps:

  1. Start PuTTY.
  2. In the Host Name (or IP address) text box, type the hostname or IP address of the server where your account is located.
  3. In the Port text box, type 7822.A2 does not use the default SSH port 22. Please SSH to port 7822 or 22.
  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. Enter your account username when prompted, and then press Enter.
  8. Type your account password when prompted, and then press Enter.
    1. For security reasons, no characters appear in the terminal as you type the password.
  9. When the remote server’s command line prompt appears, you are connected.
    1. The initial command line prompt is:[email protected] [~]#
  10. You can now run commands. For example, to see a listing of the current directory, type ls, and then press Enter.
  11. To close the SSH connection when you are done, type exit and then press Enter.

macOS and Linux operating systems

Both macOS 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.

  1. Open a terminal window. The procedure to do this depends on the operating system and desktop environment.
    • On macOS, 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
    1. A2 does not use the default SSH port 22. Please SSH to port 7822.
  3. Type your password when you are prompted to do so.
    For security reasons, no characters appear in the terminal as you type the password.
  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.

How to access your account using SSH keys

  1. Start PuTTYgen.
  2. Under Parameters, click the SSH-2 RSA radio button.
  3. Confirm that the Number of bits in a generated key value is set to 2048.
  4. Click Generate.
  5. Move the mouse around to generate random data. After a few seconds, PuTTYgen creates the key.
  6. You can optionally add a passphrase to the key. If you are generating keys to use for automated processes, you should skip this step. However, if you want to set up two-factor authentication by using key files and a passphrase, then type a password for the key in the Key Passphrase and Confirm Passphrase text boxes.
  7. Click Save public key, choose the folder, type id_rsa.pub in the File name text box, and then click Save.
  8. Click Save private key, choose the folder, type id_rsa.ppk in the File name text box, and then click Save.
  9. Select all of the text in the Public key for pasting into OpenSSH authorized_keys file text box, right-click on the text, and then click Copy.
  10. Log in to your A2 Hosting SSH account using PuTTY.
  11. At the command line on the server, type the following commands: mkdir ~/.ssh nano ~/.ssh/authorized_keys
  12. In the nano text editor, paste the public key text that you copied in step 9.
  13. Press Ctrl+x, type y to save the file, and then press Enter. nano saves the file and exits.
  14. At the command line on the server, type the following commands to set the correct file permissions:
    chmod 600 ~/.ssh/authorized_keys chmod 700 ~/.ssh
  15. To close the connection, type exit and then press Enter.

How to Access Your Server Using SSH

  • Step 1: Choose and Install an SSH Client
  • Start “PuTTY” software on your computer.
  • In “Host Name” box, type website URL or Server IP address.
  • In the “Port” box, type the port number 7822.
  • Step 2: Connect to Your Server Using Your SSH Credentials
  • Confirm “SSH” Connection Type & Hit “Open“.
  • Enter your cPanel account “Username“.
  • Enter your cPanel account “Password“.
  • When you see “[email protected] [~]#“, you’re connected.
  • Step 3: Interact With Your Server Using the Command Line
  1. Pick an SSH client, such as PuTTY, and install it.
  2. Connect to your server using your credentials.
  3. Interact with your server using the command line