This is the series of How to build / install / create an Elrond Node, either on Mainnet, Testnet or Devnet.
Part 04 – Creating and testing the SSH Keys



1. open MobaXterm on the PC – login to the server’s IP address using the root login & password (this will open a tab in MobaXterm with the IP address on it)
2. click on Session then Shell and it should get to /home/mobaxterm folder, or simply just click the + tab sign to open another tab which will be exactly the same thing
3. type the following to create and Ed25519 ssh key pair: mkdir -p $HOME/.ssh
4. then type: ssh-keygen -t ed25519 -f $HOME/.ssh/theHostingCompanyHere_ed25519 -C “theHostingCompanyHereSshKey
5. add a passphrase (and remember it because you’ll be asked for it multiple times during this entire process), and we recommend theNewPasswordForTheNewUserNameHere as the passphrase because it will be more secure and the private key will be useless without this passphrase
6. the public and private ssh keys will be on the local system here:
i. /home/mobaxterm/.ssh/theHostingCompanyHere_ed25519 .pub – the public ssh key
ii. /home/mobaxterm/.ssh/theHostingCompanyHere_ed25519 – the private ssh key
7. add the new Ed25519 key to ssh agent by typing: eval `ssh-agent -s` (those are back ticks not single quotes) OR if that won’t work type: eval “$(ssh-agent)”
8. check all the previous ssh keys by typing ssh-add -l and if you find any in there just delete all the previous keys by typing ssh-add -D and then check that again by typing ssh-add -l to see if there is anyone left in there
9. then type: ssh-add $HOME/.ssh/theHostingCompanyHere_ed25519
10. copy the public key to the server by typing ssh-copy-id theNewUserNameHere@theServerIpAddressHere then you’ll be asked for the passphrase a few times and then it will get it done
11. now the public ssh key will be there for theNewUserNameHere account on the server in this folder $HOME/.ssh/authorized_keys and to check that out do the following:
i. login to the server using ssh ‘theNewUserNameHere@theServerIpAddressHere
ii. use ls -a to see the folder .ssh then get inside of it and ls -a to look for the authorized_keys then use cat authorized_keys to see its content looking for the theHostingCompanyHereSshKey at the end of a line somewhere – and this should be the exact content of the public ssh key from step 6.1 – now if that file has some other rows in there, maybe nano the file and delete the extra rows and only keep the one with the comment from step 4.4 at the end and this makes sure there is only one ssh key allowed to connect to that server.
12-a. if the login and checking was successful, then we can proceed, we’re good, please do the following:
i. you can logout afterward by pressing CTRL+d
ii. go to the SSH-KEYS folder on the desktop and get the private and public keys/files and put them somewhere safe
iii. delete the entire .ssh folder: rm -r .ssh then check using ls -a if it is still there or it was deleted & also delete all the ssh keys as well by checking ssh-add -l them and deleting them ssh-add -D and checking them again ssh-add -l
iv. you can convert the ssh private key to the .ppk format like this:
1. open puttygen.exe
2. FileLoad Private Key — find the theHostingCompanyHere_ed25519 file (maybe show all files to be able to see it) — type the passphrase from step 5
3. FileSave Private Key — give it theHostingCompanyHere_ed25519.ppk name — save it in the same folder — and that’s the .ppk format of the ssh private key
12-b. If the login was NOT successful we have to verify the previous steps again one by one and get it right