Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

SSH Encryption Keys

Hi guys. I just started learning linux command line. I already know how to navigate directories, copy/delete/move files, mysql, drive mounting, sysctl, kernel modules and some other fun stuff.

But for some reason I'm stuck with SSH. I can't get my head around it. I can establish SSH connections between a server and a client. Sad part is when it comes to implementing additional securities like RSA, I'm totally lost. I don't understand the concept of private keys and public keys.

I already looked up youtube, google and other online resources. They say different things, and give out different shell commands.

I was wondering if you guys can help me with this. Or point me to an easy to understand guide. I want to fully grasp this subject before I move on to the next thing I wanna study.

Anyways, thanks in advance. :)
(Jan 3, 2017 12:38 AM)Yani Wrote:  What part do you not understand?

You can use a key for authentication, to login.

Or you can use a key to encrypt the actual traffic (like HTTPS).

I think it's who has which key, and who generates which. Does the client uploads a key to the server? or does the server uploads a key to the client.
(Jan 3, 2017 12:43 AM)Consulting Detective Wrote:  I think it's who has which key, and who generates which. Does the client uploads a key to the server? or does the server uploads a key to the client.

You should read my post here on PGP. It's basically the same.

You have a public key and a private key.
You upload your public key to places like servers, or anything you want to connect to. Once they have the public key, you can use the private key to connect to them.
So instead of asking you for a username and password, they already know the username (public key), so you just have to have the password (private key) on your computer to connect.

Keep your private key safe, it's basically a password.
[Image: otioqRQ.png]
You should start learning about encryption first instead blindly following guides.
https://en.wikipedia.org/wiki/Public-key_cryptography

Guides show you how to set it up, but knowing how it works can safe you from all kinds of trouble in the future.
You asked about SSH, which can use PGP keys, but what you really want to know about is PGP/GPG specifically.

Using colors is the eli5.

Skip to 02:16 to get past the history.

youtube.com/watch?v=YEBfamv-_do
Here, I'll simplify and spoonfeed you this because it's the fastest way.

Run this command:

Code
ssh-keygen -t ed25519

It'll ask you to set a passphrase, please do so.

Once the generation is complete you'll now have two new files in the directory where you ran that command.

id_ed25519 is the private key. Keep this secure and don't lose it or forget the passphrase.

id_ed25519.pub is the public key. This is the one you upload to your server. Open it in a text editor and paste the contents into the /.ssh/authorized_keys file of your user account directory.
Cybrary have a course about cryptography.
Take a chance and you can learning everything about public key and private key.
It's free


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Ubuntu] by PerformanceDirectUSAJan 28, 2019 07:59 PM 4 194 Jan 28, 2019 07:59 PM
Last Post: SuckySucky
by Ki11MachJan 4, 2019 07:12 PM 2 124 Jan 4, 2019 07:12 PM
Last Post: Ki11Mach
by BLOW.Aug 25, 2016 08:30 AM 9 325 Aug 25, 2016 08:30 AM
Last Post: BLOW.