SSH
SSH (secure shell) is a network protocol that provides secure login/access for customers to their server accounts, through a terminal program. Users on all servers are able to access their accounts over SSH. To connect to the server via SSH using PuTTY, please follow the steps below.
1. Enable the SSH access for your account. You can do this from the SSH Access section in the Control Panel.
2. Download PuTTY. PuTTY is an SSH client, which can be downloaded from the official PuTTY download page.
3. Start putty.exe.
4. Enter the following connection details in the Sessions category:
- Host name – enter your server’s host name. You can find your server’s host name listed in the upper left corner of your Control Panel.
- Port – use the default port (22).
- Connection type – choose SSH.
5. Press the Open button.
6. Add the server’s SSH key fingerprint to PuTTY’s cache by pressing the Yes button to add the server’s key to PuTTY’s list of known hosts. In that way, you will no longer receive this security warning on subsequent connection attempts from this device.
7. On the next step, the server will prompt you to enter your username and password, which are the same as your Control Panel credentials.
If you are using Mac OS X, it provides a command-line SSH client (Terminal) as part of the operating system, so you don’t need a dedicated SSH client.
To connect through your Mac Terminal, please follow the steps below. Please replace:
![]() | username with your hosting account’s Control Panel username |
1. Enable the SSH access for your account. You can do this from the SSH Access section in the Control Panel.
2. Launch Terminal by using Spotlight search in OS X, searching for terminal.
3. Through your Mac Terminal, you can connect with the following command:
ssh username@your_server.com
During your first connection attempt, you will receive the following warning – “The authenticity of host can’t be established. Are you sure you want to continue connecting (yes/no)?” You should enter yes. By doing that, the server’s key fingerprint will be added permanently to your list of known hosts. In that way, you will no longer receive this warning on subsequent connection attempts.
This article will guide you in creating and using an SSH key to log in to your account on our servers. First, you need to generate the public and private key pair. In this article, we will show you how to do that using the shell and using the control panel. Then, you need to copy the private key to your computer, or other device you will be connecting from.
If you wish, you can then disable the SSH password authentication for the account using the SSH section in the hosting Control Panel as described in our SSH Access article.
Importing an already generated key
If you have generated your public key/private key pair on your local computer or on another server, you can use the Import an existing public key subsection of the hosting Control Panel’s SSH Access section to import the public key to the server.
Supported key types
On our servers, RSA, ECDSA, and ED25519 keys are supported. We do not support the now obsolete DSA keys. The SSH keys management interface in the hosting control panel supports RSA and ED25519 keys. The interface reads and writes to the authorized_keys file. It does not support the authorized_keys2 file. We recommend that you store your keys in the authorized_keys file to ensure future compatibility with the server software.
Generating SSH keys using the Control Panel
Open the SSH Access section of the hosting Control Panel. There, you need to use the Generate a new private/public key pair subsection.
Specifying a passphrase is optional, but highly recommended. It will improve the security of your account. You will need to unlock the private key on each computer with that passphrase, so if someone steals the private key, they won’t be able to log in to the account with it. You can also enter an optional comment for your reference.
You need to copy or download the generated private key in order to be able to use the public key that will be automatically saved on the server.
Generating SSH keys using the shell
First, you need to log in to your account with SSH using a password and enter the .ssh directory:
cd ~/.ssh
There, you need to execute the following command to start the process of generating the keys:
ssh-keygen
Press Enter to confirm that you want the keys to be saved in the current directory and enter a passphrase for the private key. You will be asked to enter it twice to prevent typos. You will need to write down or remember the passphrase as you will be asked to enter it on the device you are connecting from with SSH. While it is possible to create a key without a passphrase, we do not recommend that, as the passphrase adds another layer of security.
By default, ssh-keygen will generate an RSA key. At this point, you will have two files: id_rsa and id_rsa.pub. The id_rsa file is your private key, and id_rsa.pub is your public key. You need to insert the public key as authorized key on the server. You do that by running the following command:
cat id_rsa.pub >> ~/.ssh/authorized_keys
Then copy the private key (the id_rsa file) to your computer, or other device you will be connecting from, and remove the file from the server. You will be able to use the private key in your SSH client, unlocking it with the passphrase you entered in ssh-keygen.
Using keys with SFTP
There is no problem to use key-based authentication with SFTP. In order to access the server over SFTP, you will need to set up the correct private key in your FTP client. Please note that only the main Control Panel user can connect over SFTP. All other FTP users must use FTP or FTPS and authenticate with their respective username and password combinations.
Visual Studio Code is a popular source code editor made by Microsoft. It can be configured to remotely edit the files on your hosting account over an SSH connection. We strongly recommend that you set up key-based SSH authentication for use with Visual Studio Code.
NOTE: In order to connect to your account with Visual Studio Code, there is also a configuration change that needs to be enabled for your hosting account on the server. Please contact our support team about this, otherwise you won’t be able to use Visual Studio Code over SSH.
The configuration for SSH connections in Visual Studio Code is described in detail in the Remote Development using SSH article in the official documentation of the editor. You should start by setting up your Visual Studio Code installation as described in that article. In particular, you have to install the “Remote SSH” extension.
After your editor has been set up, there are two settings in it that you have to change. The first one is “Remote.SSH: Remote Server Listen On Socket” and it needs to be enabled.
To change it, you should first open the Settings dialog by pressing Ctrl+,.
In the search field, enter Remote.SSH: Remote Server Listen On Socket
. The option will appear. It needs to be checked:
The other setting that you have to add is named Remote.SSH: Server Install Path
. You can find it the same way:
When it appears, you should click on the “Add Item” button and enter the server name of your hosting account (it can be found in the welcome email or on the left pane of the Control Panel of your hosting account) and the following path:
/home/$USER/.local/vscode-server
In the following example, the username is example
and the server name is s999.sureserver.com
. The username and the server name of your account will be different; you should use the values that apply to your account. For this example, the setting should be as follows:
Item | Value |
s999.sureserver.com | /home/$USER/.local/vscode-server |
Click “OK” to save the changes.
At this point, you can start a remote connection by pressing F1 and typing Remote-SSH: Connect
. You will get a prompt to enter the location of your account. You should enter example@s999.sureserver.com
. You may be prompted for your password or passphrase in order to authenticate to the SSH server:
If the connection is successful, you will be prompted to choose the platform on the remote host; it’s Linux:
You should now be able to edit your files remotely over SSH using Visual Studio Code.