Connecting to Your Server with SSH

Secure Shell (SSH) provides a secure way to remotely access your server when using an unsecured network. This article explains how to establish an SSH connection on either Windows and Mac OS.
Note: If you do not already have an SSH login, please contact our support desk and we will set it up for you. We may ask for your public key, which you can find using the instructions in this article.

Windows

Windows does not include a default SSH client, so we recommend installing PuTTY.
  1. Click here to get the latest version of PuTTY.

    Click on “Download it here”.

    Click on the link for the 32-bit or 64-bit version, depending on your system type. If you’re not sure of your system type, the 32-bit version will work on any system.
  2. Open PuTTY and enter your server name into the "Host Name (or IP address)" textbox.
  3. Enter the port '22000' (unless we have told you to use a different port for your server).
  4. Click “Open”.
  5. If you receive a “PuTTY Security Alert” about the host key, click “Yes”.
  6. A command prompt will appear
    login as:
    Type your server account username (your DirectAdmin username) and press Enter.
  7. Next enter the password (this is the same as your DirectAdmin login and FTP password). Note, you will not see the password as it is being typed, as a security feature. When you are done typing, press Enter.
  8. If login is successful, you will see a "Last login:" message. You are now connected to your server via SSH.

Mac

Mac includes Terminal as a default SSH client.
  1. Go to Applications > Utilities, and open Terminal.
  2. In the terminal prompt that appears, type the following command:
    ssh -p 22000 user@server
    replacing ‘user’ with your username (the same as your DirectAdmin or FTP username) and ‘server’ with your server name
  3. If you see the following message:
    The authenticity of host '198.61.208.131 (198.61.208.131)' can't be established.
    RSA key fingerprint is 47:ff:76:b4:211:0f:11:15:21:bd:92:2f:44:0a:d9:0a.
    Are you sure you want to continue connecting (yes/no)?
    type 'yes' and press Enter.
  4. Type the password (the same as your DirectAdmin or FTP password). Note, you will not see the password as it is being typed, as a security feature. When you are done typing, press Enter.
  5. If login was successful, you will see the following prompt appear
    [user@yourservername ~]#
    You are now connected to your server via SSH.

Connecting with a Public/Private Key Pair

As an alternative to logging in with your username and password, you can access a server through ssh with a public and private key pair. You will need to generate these keys if you don't already have them, and then give your public key to the system administrator to add to the server's authorized_keys file.

Windows

PuTTY comes with a key-generating tool that can be used for this purpose.
  1. Search for and open PuTTYgen.
  2. Click "Generate".
  3. Move your mouse around in the blank area provided until the green bar is full.
  4. When the key has been generated, select "Save public key" and choose a location on your system to save the public key file.
  5. Enter a passphrase in the "Key passphrase" and "Confirm passphrase" boxes. This passphrase protects your private key and you will be required to enter it whenever you use the key.
  6. Click "Save private key" and choose a location on your system to save the private key file.
  7. The text in the "Public key for pasting into..." box shows your public key. You can copy and paste this to share with the administrator of the server you need ssh access to.
Once your key pair has been created, and you have given your public key to the system administrator to add to the authorized_keys file, you will be able to log into your server using these keys.
  1. Open PuTTY.
  2. Navigate to Connection > SSH > Auth (in the left-hand menu).
  3. Click "Browse".
  4. Choose the private key file you saved previously.
  5. Navigate back to Session.
  6. Enter your server address in the "Host Name (or IP address)" box.
  7. Enter "22000" for the port (unless we have told you to use a different port).
  8. If you wish to save these connection settings for fast connection next time, click "Save".
  9. Click "Open" to connect to the server.

Mac

Mac's Terminal program can be used as an ssh client and can also generate and store its own key pairs.
  1. Go to Applications > Utilities, and open Terminal.
  2. In the terminal prompt that appears, type the following command:
    cd .ssh
    then check your directory with
    pwd
    This should show you the following response:
    /Users/[your user name]/.ssh;
  3. If this looks correct, then type the following command to create your key pair
    ssh-keygen -t rsa -b 2048 -C "Your Name" -f filename
    Just replace 'Your Name' with your name and 'filename' with the name of the file you want to create to hold your keys.
  4. When prompted for a passphrase, create a strong, difficult-to-guess passphrase to protect your private key. Hit Enter when done.
  5. This created a file named 'filename' for your private key and and a file named 'filename.pub' for your public key. Type the following command to see your public key:
    cat filename.pub
  6. Copy and paste the contents of the public key to share with the system administrator.
Once the administrator has added your public key to the authorized_keys file, you can ssh into the server using your private key.
  1. Open Terminal back up.
  2. Go to your home directory by using the following command
    cd ~/
  3. Now connect to ssh using your private key by typing the following command
    ssh -p 22000 -i .ssh/filename user@server
    replacing 'filename', 'user', and 'server' with their respective values.
  4. When prompted, enter the passphrase you created for your private key.
  5. If login is successful you will see the following prompt:
    [user@yourservername ~]#
    You are now connected to your server via SSH.
  6. The next time you connect to ssh, Terminal will remember your private key and you can log in with this command:
    ssh -p 22000 user@server

Did you find this article helpful?