What is the difference between private key and public key in SH?

Cheerag Nundlall

Well-known member
Registered
Joined
Oct 12, 2016
Messages
333
Points
18
I use SSH to login to my VPS server. It offers a public key & private key. Which should I really be using to login? What is the difference between private key and public key in SH? Does anyone explain me?
 

LJSHost

Well-known member
Hosting Provider
Registered
Joined
Jul 5, 2016
Messages
1,031
Points
63
Hi Cheerag,

Key based encryption can seem complex but it's really quite simple.

Public Key

Think of a public key as being the lock rather than a key, it's a padlock you can make lots of copies of and distribute wherever you want. For example, if you want to put your ‘padlock' on an ssh account on another machine, you would copy it to ‘authorized_keys' in the ~/.ssh folder.

Private Key

The private key is the actual key. This is what you use to open the padlock that is stored on the other machine. Anyone who has this key will be able to authenticate via key based SSH authentication.
 

Luxin Host

Well-known member
Registered
Joined
Jun 26, 2016
Messages
543
Points
43
In a basic term
In order to be able to access an account on a Secure Shell server a copy of the public key needs to be uploaded. The client's machine needs to have the public key so when the client tries to connect to the server it checks if it has the public key to that server, then the server will allow the access.
But the private key is very secure, since it cant be stolen or guessed. This is becuase private key never leaves the client's machine. And it has a passphrase which improves the security of it. The public key will never grant any access until the client has the private key.
 
Older Threads
Replies
7
Views
4,119
Replies
24
Views
8,609
Replies
2
Views
2,307
Newer Threads
Recommended Threads

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top