Create rsa key pair (public/private)

Create rsa key pair on the local computer first and then copy it to the remote server

First we need to create rsa key pair (public/private) on our local computer. The necessary steps are on the documentation provided below.

The steps involved are as follows:

Open windows PowerShell as admin.

ssh-keygen

Generating public/private rsa key pair.

Enter file in which to save the key (C:\Users\anupa/.ssh/id_rsa):

Enter passphrase (empty for no passphrase):

Enter same passphrase again:

Your identification has been saved in C:\Users\anupa/.ssh/id_rsa.

Your public key has been saved in C:\Users\anupa/.ssh/id_rsa.pub.

Here you must note two important things. You must not change the default path for saving the rsa key pair. '.ssh' folder will be automatically created under the user. Also you must create passphrase for your rsa key pair. In windows PowerShell passphrase is asked every time you access your remote server. But in Ubuntu passphrase is asked only once for the first time when you access your remote server.

Now let's check the rsa public key on your local computer with command:

cat ~/.ssh/id_rsa.pub

The output will be your rsa public key displayed on screen.

Last updated