Content
Generating an SSH-Key Pair.
If you need access to a server/vm, you will definetly need a public/private key pair. If you haven't tried using ssh keys before, you can think of your private key as your password, and your public key as your name on a list that allows you in to the given ssh server.
Generating a key on Unix-Based Systems (Linux / MacOS)
Launch a terminal window on your system.
Execute the following command: ssh-keygen -t ed25519 -C "your_email@example.com"
-C "your_email@example.com": Adds a comment to the key (your email, for identification).
Next, you need to specify a File Name. You'll be prompted to save the key pair. By default, it will save to ~/.ssh/id_ed25519. Press Enter to accept the default location or specify a different path.
After this you’ll be asked to enter a Passphrase. This is not strictly necessary, but feel free to do so, or just press Enter twice to leave it blank.
Your key pair has now been generated! :)
Once the process is complete, you'll see output similar to the following:
Your identification has been saved in /home/yourusername/.ssh/id_ed25519
Your public key has been saved in /home/yourusername/.ssh/id_ed25519.pub
Now you’re good to go, and can send the public key to us 😊
Generating a key on Windows
Open Power-Shell or Command Prompt. Win+s for Power-Shell. Search CMD for Command.
Execute the following command: ssh-keygen -t ed25519 -C "your_email@example.com"
-C "your_email@example.com": Adds a comment to identify the key (your email).
Specify a Save Location when prompted.
-
Press Enter to save to the default location: C:\Users\YourUsername\.ssh\id_ed25519.
-
If you want the key to be saved in a specific folder, type the full path ending with a file name. Example: C:\Users\YourUserName\Desktop\SSH-Keys\my_key
After this you’ll be asked to enter a Passphrase. This is not strictly necessary, but feel free to do so, or just press Enter twice to leave it blank.
Your key pair has now been generated! :)
Once the process is complete, you'll see output similar to the following:
Your identification has been saved in C:\Users\YourUsername\.ssh\id_ed25519
Your public key has been saved in C:\Users\YourUsername\.ssh\id_ed25519.pub
Now you’re good to go, and can send the public key to us 😊
Obs: Making your private key accessible on windows
For security reasons, a little work needs to be done before you can actually use your newly generated key on windows. To make sure your key has the correct permissions and is ready to use, please follow along:
-
Find the private key you just generated at either your custom location or C:\Users\YourUsername\.ssh\
-
From here, right click on your private key and go into the properties options.
- In the properties menu, navigate to the Security tab and click Advanced
- In the following menu, click "Deactivate Inheritance"
- Now click "Remove all inheritented permissions from this object”
- Now click “Add”, and then click “Add security account”.
- Now type your username for your pc, and hit “Check Names”
- Then hit “OK” and give yourself “Full control”.
- Click “Ok” and then “Apply”. Now you’re good to go! 😊🫡🎉