{"id":19943,"date":"2023-10-09T14:31:09","date_gmt":"2023-10-09T13:31:09","guid":{"rendered":"https:\/\/www.oderland.se\/support\/artikel\/create-ssh-key-pairs\/"},"modified":"2023-10-09T14:31:23","modified_gmt":"2023-10-09T13:31:23","slug":"create-ssh-key-pairs","status":"publish","type":"ht_kb","link":"https:\/\/www.oderland.se\/support\/en\/artikel\/create-ssh-key-pairs\/","title":{"rendered":"Create SSH key pairs"},"content":{"rendered":"\n<p>SSH (Secure Shell) is used to securely connect to remote servers. SSH key pairs consist of two parts: a private key that you keep secure on your local computer and a public key that you share with the servers you want to connect to.<\/p>\n\n<p>If you want to create a key pair and use it for your web hosting or managed service, we have a <a href=\"https:\/\/www.oderland.se\/support\/en\/artikel\/how-do-i-connect-to-my-web-hosting-account-using-ssh\/\" data-type=\"link\" data-id=\"https:\/\/www.oderland.se\/support\/artikel\/hur-ansluter-jag-med-ssh-till-ett-webbhotellkonto\/\">guide on how to create it via cpanel<\/a>.<\/p>\n\n<h2 class=\"wp-block-heading\">Execution<\/h2>\n\n<p>Here are the steps to create an SSH key pair in Linux.<\/p>\n\n<h3 class=\"wp-block-heading\"><strong>Open the terminal<\/strong><\/h3>\n\n<p>To start, open a terminal on your Linux computer. You can use programs like Terminal, Console, or xterm, depending on your Linux distribution.<\/p>\n\n<h3 class=\"wp-block-heading\"><strong>Create SSH key pairs<\/strong><\/h3>\n\n<p>Use the command <code>ssh-keygen<\/code> to create an SSH key pair. If you don&#8217;t set any flags, the command will use the default settings, including the RSA key type, and save the keys in your home folder in a subfolder called <code>.ssh<\/code>. You can also specify another location to save the keys if you wish.<\/p>\n\n<pre class=\"wp-block-preformatted\">ssh-keygen<\/pre>\n\n<p>If you want to use a different key type, like Ed25519 (recommended), you can use the <code>-t<\/code> flag:<\/p>\n\n<pre class=\"wp-block-preformatted\">ssh-keygen -t ed25519<\/pre>\n\n<h3 class=\"wp-block-heading\"><strong>Enter a file to save the key (optional)<\/strong><\/h3>\n\n<p>By default, <code>ssh-keygen<\/code> stores the keys in your home folder in a subfolder called <code>.ssh<\/code> with the names <code>id_rsa<\/code> (private key) and <code>id_rsa.pub<\/code> (public key). If you want to specify a different file to save the keys, you can use the <code>-f<\/code> flag:<\/p>\n\n<pre class=\"wp-block-preformatted\">ssh-keygen -f \/desired\/path\/to\/key file<\/pre>\n\n<h3 class=\"wp-block-heading\"><strong>Create a passphrase (recommended)<\/strong><\/h3>\n\n<p>You can also protect your private key with a passphrase for extra security. This means that you have to enter the passphrase every time you use your private key. If you want to add a passphrase, enter it when prompted.<\/p>\n\n<h3 class=\"wp-block-heading\"><strong>Complete the process<\/strong><\/h3>\n\n<p>After entering all the desired settings, <code>ssh-keygen<\/code> will create your SSH key pair. You will receive a confirmation that the key pair has been created and where it has been saved.<\/p>\n\n<p>Now you have successfully created an SSH key pair in Linux. You can copy the public key (<code>id_rsa.pub<\/code> or whatever you have named it) and use it to authenticate yourself on a remote server. You should protect your private key carefully and not share it with anyone.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SSH (Secure Shell) is used to securely connect to remote servers. SSH key pairs consist of two parts: a private key that you keep secure on your local computer and a public key that you share with the servers you want to connect to. If you want to create a&#8230;<\/p>\n","protected":false},"author":15,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"ht-kb-category":[682],"ht-kb-tag":[],"class_list":["post-19943","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-cloud-en"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/ht-kb\/19943","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/comments?post=19943"}],"version-history":[{"count":3,"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/ht-kb\/19943\/revisions"}],"predecessor-version":[{"id":19946,"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/ht-kb\/19943\/revisions\/19946"}],"wp:attachment":[{"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/media?parent=19943"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/ht-kb-category?post=19943"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/www.oderland.se\/support\/en\/wp-json\/wp\/v2\/ht-kb-tag?post=19943"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}