Generate Ssh Rsa Key Pair Windows

The Commands to Run

Generate a 2048 bit RSA Key

You can generate a public and private RSA key pair like this:

Export the RSA Public Key to a File

This is a command that is

Do Not Run This, it Exports the Private Key

A previous version of the post gave this example in error.

Visually Inspect Your Key Files

It is important to visually inspect you private and public key files to makesure that they are what you expect. OpenSSL will clearly explain the nature ofthe key block with a -----BEGIN RSA PRIVATE KEY----- or -----BEGIN PUBLIC KEY-----.

  • less private.pem to verify that it starts with a -----BEGIN RSA PRIVATE KEY-----
  • less public.pem to verify that it starts with a -----BEGIN PUBLIC KEY-----

The Generated Key Files

The generated files are base64-encoded encryption keys in plain text format.If you select a password for your private key, its file will be encrypted withyour password. Be sure to remember this password or the key pair becomes useless.

The private.pem file looks something like this:

The public key, public.pem, file looks like:

Protecting Your Keys

Depending on the nature of the information you will protect, it’s important tokeep the private key backed up and secret. The public key can be distributedanywhere or embedded in your web application scripts, such as in your PHP,Ruby, or other scripts. Again, backup your keys!

Oh, and one last thing.

If you, dear reader, were planning any funny business with the private key that I have just published here. Know that they were made especially for this series of blog posts. I do not use them for anything else.

Found an issue?

Rietta plans, develops, and maintains applications.

Learn more about our services or drop us your email and we’ll e-mail you back.

Other Blog Articles Published by Rietta.com

Introduction

Steps to Creating SSH keys on CentOS

Step 1: Create SSH Key Pair

1. Start by logging into the source machine (local server) and creating a 2048-bit RSA key pair using the command:

Windows Generate Ssh Key Pair

Now you need to add the public key to the remote CentOS server.

  1. using the ssh-copy-id script
  2. using Secure Copy (scp)
  3. manually copying the key

Generate Ssh Rsa Key Pair Windows 6

chmod 700 makes the file executable, while chmod 600 allows the user to read and write the file.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store