I am using MobaXterm to give you an example of using ssh with a custom public key

Step #1: Create your custom RSA key

ssh-keygen -t rsa -f ~/.ssh/devoprun.rsa
I will show an example of the key creation in Example1, after the instructions.

Step #2: Export you public key to the remote server authorized_keys file

# get the contents
cat /home/mobaxterm/.ssh/devoprun.rsa.pub
# and paste its contents to
edit vim ~/.ssh/authorized_keys

Step #3: Connect ssh with your custom public key

Now, you should be able to connect ssh using a custom public key with mobaxterm
ssh -i ~/.ssh/devoprun.rsa username@hostname


Example No#1:

/home/mobaxterm$ ssh-keygen -t rsa -f ~/.ssh/devoprun.rsa
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/mobaxterm/.ssh/devoprun.rsa.
Your public key has been saved in /home/mobaxterm/.ssh/devoprun.rsa.pub.
The key fingerprint is:
SHA256:CRmWqCBAilO/NsQZpSNEm99UUjTbaZBHAHR5lezjz3s admin@devopsrun
The key's randomart image is:
+---[RSA 2048]----+
| oX++*=*o.       |
|+=oXo*+So        |
|*o* @.o.         |
|.+.+ o .o.       |
|.i. +  .S.       |
|i. . .  .        |
|.        0o     |
|         .o      |
|        E ..     |