To log in to the SSH of your hosting package, you have 2 methods:
Via username and password.
Via SSH authorized keys.
In this article, we explain how to create the keys that you use for method 2 for Windows and MacOS. (For method 1, see this article: connecting to ssh)
After this process, you will have 2 keys, the public and the private keys. You authorize the public key on the hosting package and use the private key to log in to a place where the public key is authorized. You can therefore see the private key as a kind of password.
Windows
Download and install PuTTY
To start, download PuTTY on your Windows PC, which can be done via this link: PuTTY Download Link
You will now arrive at a page with multiple download options, scroll to the Package files section. Here you have 3 options under MSI ('Windows Installer'):
64-bit x86
64-bit Arm
32-bit x86
In most cases, the 1st option (64-bit x86) is the right choice. If the 1st option does not work during installation, simply try option 2 and then option 3 if it still does not work.
Creating a key
Now that PuTTY is installed, we can create the keys. Open the program PuTTYgen in Windows.
For now, do not open PuTTY yet, only PuTTYgen.
You will now have a small window in front of you with the title PuTTY Key Generator. First, in the Parameters section, set the option to Ed25519. Then click the Generate button in this window.
You will now be asked to move the mouse to generate the keys, move your mouse under the loading bar in the empty area until the bar is completely full and you can see the key.
When this process is complete, select all the text in the top field, this is the public key. Save this safely by copying and pasting this text into a text file on your PC. Name this file, for example, "pubkey.txt".
Once you have done this, also click the Save private key button. Save this private key in the same location as your public key from the previous step. (This is a separate .ppk file.)The Save public key button is essentially not needed because you have already saved the public key in the previous step. You can now safely close PuTTYgen.
Please note: The Save public key button saves the public key in a different format than if you manually copy the text and save it in a text file. This version from the button will actually not be accepted by DirectAdmin, which is why we save this by copying the first field and pasting it into a text file.
The SSH Keys have now been successfully created, as the next step you can add them to the hosting package to authorize them.
Once the public key has been added and authorized, you can use PuTTY to log into SSH with the private key.
Open the PuTTY program in Windows.
So open PuTTY, not PuTTYgen.
Now go to Connection > SSH > Auth. in the left menu in PuTTY.
A screen with options will now open, click the Browse button at the bottom right.
Now navigate to the location where you saved the Private Key, this is the .ppk file which we saved in the previous steps at step 4. Select this file, it will be saved with the name "privkey.ppk".
Now go back to the 1st option in the left menu, Session.
Type your domain name or the hostname of the server in the Host Name (or IP address) field. To keep it simple, you can just enter your domain name here. Alternatively, you can use the mijn.host server name. If you are logged into DirectAdmin, this is shown in the URL bar. This could be for example h8.mijn.host, h32.mijn.host etc.I do not know what to enter
If you are not sure what to enter or if it is not working, please ask our support.
You can also check the control panel to see which IP your hosting package has. Then enter this IP in the field: Host Name (or IP address)
You can find the IP here:
In the example below we use h8.mijn.host.
Type the number 26 in the Port field.
Once these details are filled in, click the Open button at the bottom, a new window will open.
In this new window you will see Login as:, type your DirectAdmin username here. In the example below our username is "auwdomei".
You received the DirectAdmin username and password from us via email when purchasing your hosting package.
In most cases, your username will consist of 2 letters followed by your customer number. For example az123456. Always use lowercase letters.
Then press enter, you will now see the message that you are authenticated with the public key that you created earlier and added to DirectAdmin.
You are now successfully logged in via SSH to the server! Should you still run into any problems, please feel free to let our support know, they will gladly help you solve your issues.
MacOS
Create a key
To create an SSH key within MacOS or another UNIX/Linux OS, you do not need any additional software. This can simply be done from the built-in Terminal app, which also allows you to connect directly to an SSH host.
Open the Terminal app in MacOS. You can open the Terminal app by searching with Spotlight. You do this with ⌘ (command) + Space. Then type Terminal and press Enter. You can also find Terminal in your Applications folder. Open Finder, go to Applications and open the Utilities folder. This contains the Terminal app, double-click Terminal.app to open the Terminal. Another option is to open Finder, then execute this command: ⌘ (command) + ⇧ (Shift) + U. Then double-click on Terminal.
When the Terminal app is opened, type the following:
ssh-keygen -t ed25519
After that you will be asked at which location you want to save this file to, for example (/Users/gebruikersnaam/.ssh/id_ed25519). You can press enter if you are fine with the suggested location. Note that you must save the key within the .ssh folder.
Next, you will be asked to enter a password. This is optional. If you provide a password, you will need to enter this password every time you try to connect to a host or server via SSH. This is an extra layer of security, should your SSH private key ever be stolen. We recommend that you do set a password.
Your SSH key is now created. You can view the key that must be saved on the server with the following command (note, gebruikersnaam is an example):
Replace gebruikersnaam with the actual username of your computer (which was also shown in step 3). If you chose a different location in step 3, then adjust the above command with the correct location, appended with .pub
The SSH key has now been created. You can upload your public key to the server you want to log into to then be able to log in with your SSH key.