{"id":669,"date":"2016-10-18T00:00:00","date_gmt":"2016-10-18T00:00:00","guid":{"rendered":"http:\/\/blog.hostinger.io\/hostinger-tutorials\/uncategorized\/vpshow-to-generate-ssh-keys-on-putty\/"},"modified":"2026-03-09T19:20:13","modified_gmt":"2026-03-09T19:20:13","slug":"how-to-generate-ssh-keys-on-putty","status":"publish","type":"post","link":"\/ng\/tutorials\/how-to-generate-ssh-keys-on-putty","title":{"rendered":"How to use PuTTY to generate SSH key pairs for site security"},"content":{"rendered":"<?xml encoding=\"utf-8\" ?><p>SSH keys are one of the most secure SSH authentication options. It is definitely more secure than the usual SSH password authentication. Therefore, it is highly recommended to use SSH Key authentication method for connections to your servers.<\/p><p>With password authentication, you can connect to your server from any location, you only need to fill in your password. However, if your password gets leaked, it is a major risk as anyone who knows your password will be able to get into the server.<\/p><p>SSH Key authentication only allows connections from clients whose key matches the one on the server. Basically, you generate a key pair (private key and public key). The private key is placed on your local machine and the public key is uploaded to the server. When connecting to the server, a validation of these two keys is made and if the key pair passes the validation you are allowed to connect. Of course, you can upload keys of multiple users so that you or other authorized users would be able to connect to the server from different computers.<\/p><p>As you can see this is a much safer connection method. In this tutorial, we will focus on Windows users who use <strong>PuTTY<\/strong> for connections to the server and show how to generate <strong>PuTTY<\/strong> <strong>SSH Keys<\/strong>. If you want to generate SSH Keys on Linux or Mac, see <a href=\"\/ng\/tutorials\/ssh\/how-to-set-up-ssh-keys\">this tutorial<\/a>.<\/p><p class=\"has-text-align-center\"><a href=\"https:\/\/assets.hostinger.com\/content\/tutorials\/pdf\/SSH-Cheat-Sheet-EN.pdf\">Download ultimate SSH commands cheat sheet<\/a><\/p><h2 class=\"wp-block-heading\" id=\"h-what-you-ll-need\">What you&rsquo;ll need<\/h2><p>Before you begin this guide you&rsquo;ll need the following:<\/p><ul class=\"wp-block-list\">\n<li>Access to your Linux server \/ VPS<\/li>\n\n\n\n<li><strong>PuTTY<\/strong> and <strong>PuTTYgen<\/strong> installed on your computer (<a href=\"http:\/\/www.chiark.greenend.org.uk\/~sgtatham\/putty\/download.html\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Download here<\/a>)<\/li>\n<\/ul><h2 class=\"wp-block-heading\" id=\"h-step-1-downloading-puttygen\">Step 1 &mdash; Downloading PuTTYgen<\/h2><p>Most of you have <strong>PuTTY<\/strong> installed on your computers already, however, to generate SSH Keys you also will need <strong>PuTTYgen<\/strong>.<\/p><p>1. Download <strong>PuTTYgen <\/strong>from <a href=\"https:\/\/www.chiark.greenend.org.uk\/~sgtatham\/putty\/latest.html\" target=\"_blank\" rel=\"noreferrer noopener\">the official website<\/a>.<br>2. You should be able to see this file downloaded:<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2017\/03\/generate-ssh-keys-putty2.png\"><img loading=\"lazy\" decoding=\"async\" width=\"178\" height=\"141\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2017\/03\/generate-ssh-keys-putty2.png\/public\" alt=\"The puttygen.exe file\" class=\"wp-image-1057\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2017\/03\/generate-ssh-keys-putty2.png\/w=178,fit=scale-down 178w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2017\/03\/generate-ssh-keys-putty2.png\/w=150,fit=scale-down 150w\" sizes=\"auto, (max-width: 178px) 100vw, 178px\" \/><\/a><\/figure><\/div><p>No installation is required for PuTTYgen. It will run when you execute the file.<\/p><h2 class=\"wp-block-heading\" id=\"h-step-2-generating-your-ssh-key-pair\">Step 2 &mdash; Generating your SSH Key pair<\/h2><p>1. Open up <strong>PuTTYgen<\/strong> by double-clicking on the <strong>puttygen.exe<\/strong> file you have downloaded in <strong>Step 1<\/strong>. You should be able to see a window like this:<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2016\/10\/puttygen-main.png\"><img loading=\"lazy\" decoding=\"async\" width=\"593\" height=\"464\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/puttygen-main.png\/public\" alt=\"The main puttygen window\" class=\"wp-image-94427\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/puttygen-main.png\/w=593,fit=scale-down 593w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/puttygen-main.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/puttygen-main.png\/w=150,fit=scale-down 150w\" sizes=\"auto, (max-width: 593px) 100vw, 593px\" \/><\/a><\/figure><\/div><p>2. Before generating your SSH Key pair, you can edit some settings, for example, key length. However, in most cases, the default options will work just fine.<br>3. Generate your SSH Key pair by clicking the <strong>Generate<\/strong> button.<br>4. When the progress bar starts loading, move your mouse randomly across the area to load up the bar and generate your key pair.<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2016\/10\/puttygen-generating.png\"><img loading=\"lazy\" decoding=\"async\" width=\"596\" height=\"468\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/puttygen-generating.png\/public\" alt=\"The process of generating new SSH key via puttygen\" class=\"wp-image-94428\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/puttygen-generating.png\/w=596,fit=scale-down 596w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/puttygen-generating.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/puttygen-generating.png\/w=150,fit=scale-down 150w\" sizes=\"auto, (max-width: 596px) 100vw, 596px\" \/><\/a><\/figure><\/div><p>5. Your public SSH key will be displayed on the screen:<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2016\/10\/puttygen-generated.png\"><img loading=\"lazy\" decoding=\"async\" width=\"593\" height=\"463\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/puttygen-generated.png\/public\" alt=\"The generated SSH key window on puttygen\" class=\"wp-image-94429\" style=\"width:593px;height:463px\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/puttygen-generated.png\/w=593,fit=scale-down 593w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/puttygen-generated.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/puttygen-generated.png\/w=150,fit=scale-down 150w\" sizes=\"auto, (max-width: 593px) 100vw, 593px\" \/><\/a><\/figure><\/div><p>If you are going to use the key for a Linux-based VPS, make sure to copy the OpenSSH public key somewhere now since Linux systems don&rsquo;t support the default Putty format. <\/p><p>6. For additional security, it is highly recommended to think of a passphrase for your SSH key (However, you can also leave it empty):<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2016\/10\/puttygen-paraphrase.png\"><img loading=\"lazy\" decoding=\"async\" width=\"589\" height=\"215\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/puttygen-paraphrase.png\/public\" alt=\"The paraphrase window on puttygen\" class=\"wp-image-94430\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/puttygen-paraphrase.png\/w=589,fit=scale-down 589w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/puttygen-paraphrase.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/puttygen-paraphrase.png\/w=150,fit=scale-down 150w\" sizes=\"auto, (max-width: 589px) 100vw, 589px\" \/><\/a><\/figure><\/div><p>7. Save your private key to any desired location on your computer and name it anything you like.<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2016\/10\/puttygen-saveprivatekey.png\"><img loading=\"lazy\" decoding=\"async\" width=\"589\" height=\"112\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/puttygen-saveprivatekey.png\/public\" alt=\"The process of saving a private key on puttygen\" class=\"wp-image-94433\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/puttygen-saveprivatekey.png\/w=589,fit=scale-down 589w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/puttygen-saveprivatekey.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/puttygen-saveprivatekey.png\/w=150,fit=scale-down 150w\" sizes=\"auto, (max-width: 589px) 100vw, 589px\" \/><\/a><\/figure><\/div><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2016\/10\/save-putty-key.png\"><img loading=\"lazy\" decoding=\"async\" width=\"732\" height=\"464\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/save-putty-key.png\/public\" alt=\"The process of saving a private key on puttygen\" class=\"wp-image-94437\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/save-putty-key.png\/w=732,fit=scale-down 732w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/save-putty-key.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/save-putty-key.png\/w=150,fit=scale-down 150w\" sizes=\"auto, (max-width: 732px) 100vw, 732px\" \/><\/a><\/figure><\/div><p>8. Save your public key to the same location on your computer and name it anything you like.<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2016\/10\/save-putty-key-public.png\"><img loading=\"lazy\" decoding=\"async\" width=\"737\" height=\"459\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/save-putty-key-public.png\/public\" alt=\"The process of saving a public key on puttygen\" class=\"wp-image-94438\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/save-putty-key-public.png\/w=737,fit=scale-down 737w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/save-putty-key-public.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/save-putty-key-public.png\/w=150,fit=scale-down 150w\" sizes=\"auto, (max-width: 737px) 100vw, 737px\" \/><\/a><\/figure><\/div><p>And that is it, you have generated your SSH Key pair. The private key will stay on your computer (do not provide it to anyone), while your public key needs to be uploaded to the server you wish to connect to.<\/p><h2 class=\"wp-block-heading\" id=\"h-step-3-setting-up-your-private-key-on-putty\">Step 3 &mdash; Setting up your private key on PuTTY<\/h2><p>In order for the server to recognize your computer when connecting from PuTTY, you need to attach the private key to PuTTY.<\/p><p>1. Open up <strong>PuTTY<\/strong> and navigate to <strong>Connection &rarr; SSH &rarr; Auth<\/strong> &rarr; <strong>Credentials<\/strong> in the left sidebar.<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2016\/10\/putty-credentials.png\"><img loading=\"lazy\" decoding=\"async\" width=\"445\" height=\"434\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/putty-credentials.png\/public\" alt=\"The credentials window on putty client\" class=\"wp-image-94439\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/putty-credentials.png\/w=445,fit=scale-down 445w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/putty-credentials.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/putty-credentials.png\/w=150,fit=scale-down 150w\" sizes=\"auto, (max-width: 445px) 100vw, 445px\" \/><\/a><\/figure><\/div><p>2. Browse for your private key file in the field <strong>Private key for authentication<\/strong>.<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2016\/10\/putty-privatekey-browse.png\"><img loading=\"lazy\" decoding=\"async\" width=\"445\" height=\"435\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/putty-privatekey-browse.png\/public\" alt=\"The browse button on putty client\" class=\"wp-image-94440\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/putty-privatekey-browse.png\/w=445,fit=scale-down 445w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/putty-privatekey-browse.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/putty-privatekey-browse.png\/w=150,fit=scale-down 150w\" sizes=\"auto, (max-width: 445px) 100vw, 445px\" \/><\/a><\/figure><\/div><p>3. Select the private key file with <strong>.ppk<\/strong> ending and click <strong>Open<\/strong>.<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2016\/10\/putty-privatekey-select.png\"><img loading=\"lazy\" decoding=\"async\" width=\"631\" height=\"417\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/putty-privatekey-select.png\/public\" alt=\"The process of selecting the private key for putty client\" class=\"wp-image-94441\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/putty-privatekey-select.png\/w=631,fit=scale-down 631w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/putty-privatekey-select.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/putty-privatekey-select.png\/w=150,fit=scale-down 150w\" sizes=\"auto, (max-width: 631px) 100vw, 631px\" \/><\/a><\/figure><\/div><h2 class=\"wp-block-heading\" id=\"h-step-4-adding-public-key-to-server\">Step 4 &ndash; Adding public key to server<\/h2><p>Lastly, you need to upload your public key to the server. There are two methods for that:<\/p><p><strong>Method 1 &ndash; Using hPanel<\/strong><\/p><p>The easiest method to upload your public key is via hPanel. <\/p><p>1. Start by selecting your server:<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-vps.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1007\" height=\"455\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-vps.png\/public\" alt=\"The main hPanel VPS page\" class=\"wp-image-79616\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-vps.png\/w=1007,fit=scale-down 1007w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-vps.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-vps.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/03\/hpanel-vps.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1007px) 100vw, 1007px\" \/><\/a><\/figure><\/div><p>2. Then, navigate to the <strong>Settings <\/strong>&rarr; <strong>SSH keys <\/strong>page and click on the <strong>Add SSH key <\/strong>button:<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2016\/10\/hpanel-vps-settings-sshkeys-addsshkey-highlighted.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"270\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/hpanel-vps-settings-sshkeys-addsshkey-highlighted.png\/public\" alt=\"The SSH Keys page on hPanel. The button to add a SSH key is highlighted\" class=\"wp-image-94442\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/hpanel-vps-settings-sshkeys-addsshkey-highlighted.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/hpanel-vps-settings-sshkeys-addsshkey-highlighted.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/hpanel-vps-settings-sshkeys-addsshkey-highlighted.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/hpanel-vps-settings-sshkeys-addsshkey-highlighted.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div><p>3. Fill in the details and paste the OpenSSH key you&rsquo;ve copied earlier from the main PuTTYgen window:<\/p><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2016\/10\/hpanel-vps-settings-sshkeys-addsshkey-window.png\"><img loading=\"lazy\" decoding=\"async\" width=\"766\" height=\"598\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/hpanel-vps-settings-sshkeys-addsshkey-window.png\/public\" alt=\"The process of adding a new public key on hPanel\" class=\"wp-image-94443\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/hpanel-vps-settings-sshkeys-addsshkey-window.png\/w=766,fit=scale-down 766w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/hpanel-vps-settings-sshkeys-addsshkey-window.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2016\/10\/hpanel-vps-settings-sshkeys-addsshkey-window.png\/w=150,fit=scale-down 150w\" sizes=\"auto, (max-width: 766px) 100vw, 766px\" \/><\/a><\/figure><\/div><p>4. Lastly, hit the <strong>Add SSH key<\/strong> button.<\/p><p><div class=\"protip\">\n                    <h4 class=\"title\">&#128161; Pro tip<\/h4>\n                    <p>On <a href=\"\/ng\/vps-hosting\">Hostinger's VPS<\/a>, use <strong>Kodee AI Assistant<\/strong> to verify if a public key has been added. Access it via your VPS dashboard, then ask, \"What public SSH key is added to my VPS?\" If <strong>Kodee<\/strong> returns a key, you've successfully added a key to your server.<\/p>\n                <\/div>\n\n\n\n<\/p><p><strong>Method 2 &ndash; Manually<\/strong><\/p><ol class=\"wp-block-list\">\n<li>On your local computer, open public key file (<strong>id_rsa.pub<\/strong>) you generated in <strong>Step 2<\/strong> with any text editor and copy its contents (public key).<\/li>\n\n\n\n<li>Connect to your VPS using Putty. See <a href=\"\/ng\/tutorials\/how-to-use-putty-ssh\">this guide<\/a> for detailed steps.<\/li>\n\n\n\n<li>If <strong>.ssh<\/strong> folder does not exist, create it together with <strong>authorized_keys<\/strong> file with the following command:<br><code>mkdir ~\/.ssh | touch ~\/.ssh\/authorized_keys<\/code><\/li>\n\n\n\n<li>Secure SSH Key file by changing permissions:<br><code>chmod 0700 ~\/.ssh; chmod 0644 ~\/.ssh\/authorized_keys<\/code><\/li>\n\n\n\n<li>Open <strong>authorized_keys<\/strong> file with <strong>vim<\/strong> text editor:<br><code>vim ~\/.ssh\/authorized_keys<\/code><\/li>\n\n\n\n<li>Press <strong>i<\/strong> key on your keyboard and right mouse button to paste the public key.<\/li>\n\n\n\n<li>Press <strong>Esc<\/strong> button and type in <code>:x<\/code>, hit <strong>Enter<\/strong> button. This command will save changes made to the file.<\/li>\n<\/ol><p>That is it, you can now use SSH keys instead of SSH password authentication to connect to your VPS.<\/p><?xml encoding=\"utf-8\" ?><figure class=\"wp-block-image size-large\"><a class=\"hgr-tutorials-cta hgr-tutorials-cta-vps-hosting\" href=\"\/ng\/vps-hosting\" target=\"_blank\" rel=\"noreferrer noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"300\" src=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner.png\/public\" alt=\"\" class=\"wp-image-77934\" srcset=\"https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner.png\/w=1024,fit=scale-down 1024w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner.png\/w=300,fit=scale-down 300w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner.png\/w=150,fit=scale-down 150w, https:\/\/imagedelivery.net\/LqiWLm-3MGbYHtFuUbcBtA\/wp-content\/uploads\/sites\/2\/2023\/02\/VPS-hosting-banner.png\/w=768,fit=scale-down 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2><p>You have learned how to generate PuTTY SSH Keys using PuTTYgen. This will make your connection to the server a lot more secure and convenient as you will not need to fill in the password each time. We recommend using this way of SSH authentication at all times and disable password authentication for good to completely secure your server. <\/p><p>To find out how to completely disable SSH Password authentication on your server and use SSH Key authentication instead, follow this tutorial: <a href=\"\/ng\/tutorials\/vps\/how-to-disable-ssh-password-authentication-on-vps\">How to disable SSH Password authentication on VPS<\/a>.<\/p><p><div class=\"protip\">\n                    <h4 class=\"title\">Suggested Reading<\/h4>\n                    <p>Read our article to learn how to <a href=\"\/ng\/tutorials\/ssh\/how-to-set-up-ssh-keys\">set up SSH keys<\/a> and manage them effectively.<\/p>\n                <\/div>\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SSH keys are one of the most secure SSH authentication options. It is definitely more secure than the usual SSH password authentication. Therefore, it is highly recommended to use SSH Key authentication method for connections to your servers. With password authentication, you can connect to your server from any location, you only need to fill [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/ng\/tutorials\/how-to-generate-ssh-keys-on-putty\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":27,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"How to Use Putty to Generate SSH Key Pairs","rank_math_description":"SSH keys are one of the most secure SSH authentication options. In this tutorial you will learn how to generate SSH keys on PuTTY.","rank_math_focus_keyword":"how to generate ssh keys on putty","footnotes":""},"categories":[22644],"tags":[],"class_list":["post-669","post","type-post","status-publish","format-standard","hentry","category-vps"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/how-to-generate-ssh-keys-on-putty","default":0},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/tutoriales\/como-generar-claves-ssh-en-putty","default":0},{"locale":"en-UK","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/how-to-generate-ssh-keys-on-putty","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/how-to-generate-ssh-keys-on-putty","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/how-to-generate-ssh-keys-on-putty","default":0},{"locale":"es-MX","link":"https:\/\/www.hostinger.com\/mx\/tutoriales\/como-generar-claves-ssh-en-putty","default":0},{"locale":"es-CO","link":"https:\/\/www.hostinger.com\/co\/tutoriales\/como-generar-claves-ssh-en-putty","default":0},{"locale":"es-AR","link":"https:\/\/www.hostinger.com\/ar\/tutoriales\/como-generar-claves-ssh-en-putty","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/how-to-generate-ssh-keys-on-putty","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/how-to-generate-ssh-keys-on-putty","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/how-to-generate-ssh-keys-on-putty","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/how-to-generate-ssh-keys-on-putty","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts\/669","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/users\/27"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/comments?post=669"}],"version-history":[{"count":13,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts\/669\/revisions"}],"predecessor-version":[{"id":145427,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/posts\/669\/revisions\/145427"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/media?parent=669"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/categories?post=669"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/ng\/tutorials\/wp-json\/wp\/v2\/tags?post=669"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}