How to create a SSH key on Elementary OS 6.1 or any other Ubuntu-based Linux distribution via the terminal emulator?

How to create a SSH key on Elementary OS 6.1 or any other Ubuntu-based Linux distribution via the terminal emulator?


Check your operating system info

LSB release tool

lsb_release -a

The lsb_release -a command is used to display detailed information about the Linux distribution on your system.

It stands for "Linux Standard Base release" and provides information such as the distribution's name, release number, codename, and more.


Linux installed info

cat /etc/os-release

Running the cat /etc/os-release command in the terminal will display the contents of the /etc/os-release file, which contains information about the Linux distribution installed on your system.


Generate SSH-key

ssh-keygen -t rsa -b 2048 -C "your email"

Replace "your email" with your actual email address.

The -t parameter specifies the type of key to create (in this case, RSA).

The -b parameter specifies the key length.

The -C parameter provides a comment (usually your email address) to help you identify the key later.


Enter file

You can choose the path and filename.

If you just want to use the default name, press Enter, otherwise, provide the name/path of the file.

Enter file in which to save the key (/home/elitebughunter/.ssh/id_ed25519):

Output

I chose the following as the file name and location:

/home/elitebughunter/.ssh/ssh_key_mnt_elementary

Enter passphrase

If you don't want to provide a password, just press Enter

Created directory '/home/elitebughunter/.ssh'.
Enter passphrase (empty for no passphrase):

Result


List all your ssh keys

ls ~/.ssh/

Verify the key

cat ~/.ssh/ssh_key_mdt.pub

Output

ssh-ed25519 AAZACZNzaZ2lZZI1NZE5ZAAAIOj3BR10R5aZetC7+EY4OIOZuwunQaZww9kxZWdwaZZZ youremail@outlook.com.br

Done


Celebrate

You've made it!

The Office GIF - The Office Happy - Discover & Share GIFs


Let's become friends


Final thoughts

I hope this article has been helpful to you. Please feel free to reach out if you have any questions. Your thoughts, suggestions, and corrections are more than welcome.

By the way, don't hesitate to drop your suggestions for new blog articles.

I look forward to seeing you next time.