{"id":462,"date":"2015-12-28T14:44:57","date_gmt":"2015-12-28T13:44:57","guid":{"rendered":"http:\/\/www.schoen-bloed.at\/blog\/?p=462"},"modified":"2015-12-28T16:02:57","modified_gmt":"2015-12-28T15:02:57","slug":"wie-erstellt-man-ssh-keys","status":"publish","type":"post","link":"https:\/\/www.schoen-bloed.at\/blog\/2015\/12\/wie-erstellt-man-ssh-keys\/","title":{"rendered":"Wie erstellt man SSH Keys?"},"content":{"rendered":"<p>Das Erstellen ist sehr einfach, die Wahl des richtigen Verfahrens ist es nicht unbedingt.<br \/>\n<!--more--><br \/>\nDerzeit (Ende 2015) m\u00f6chte man (in dem Fall ich) ed25519 als Algorithmus einsetzen. Alternativ w\u00e4re auch RSA mit 2048 oder 4096 bit l\u00e4nge ok.<br \/>\n<code>ssh-keygen -t ed25519<\/code><br \/>\noder<br \/>\n<code>ssh-keygen -t rsa -b 4096<\/code><br \/>\nMehr ist es auch nicht um einen SSH key zu erstellen. Zu beachten ist allerdings noch die <em>passphrase<\/em> und der Kommentar.<br \/>\n<code>example@server:~$ ssh-keygen -t ed25519 -C example@schoen-bloed.at<br \/>\nGenerating public\/private ed25519 key pair.<br \/>\nEnter file in which to save the key (\/home\/example\/.ssh\/id_ed25519): .\/example\/id_ed25519<br \/>\nEnter passphrase (empty for no passphrase):<br \/>\nEnter same passphrase again:<br \/>\nYour identification has been saved in .\/example\/id_ed25519.<br \/>\nYour public key has been saved in .\/example\/id_ed25519.pub.<br \/>\nThe key fingerprint is:<br \/>\n81:d4:92:81:ae:76:88:37:4e:ed:eb:ec:9b:fe:3a:bf example@schoen-bloed.at<br \/>\nThe key's randomart image is:<br \/>\n+--[ED25519&nbsp;256]--+<br \/>\n|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.o+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br \/>\n|&nbsp;&nbsp;&nbsp;&nbsp;..o..&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br \/>\n|&nbsp;&nbsp;&nbsp;.&nbsp;&nbsp;...&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br \/>\n|&nbsp;&nbsp;&nbsp;&nbsp;.&nbsp;&nbsp;&nbsp;&nbsp;.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br \/>\n|&nbsp;.&nbsp;+&nbsp;&nbsp;&nbsp;&nbsp;S&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br \/>\n|.&nbsp;B&nbsp;o&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br \/>\n|&nbsp;=&nbsp;+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br \/>\n|&nbsp;&nbsp;..o.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br \/>\n|&nbsp;&nbsp;&nbsp;+XBE.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|<br \/>\n+-----------------+<br \/>\n<\/code><br \/>\nIn diesem Beispiel verwendet ich als Kommentar <em>example@schoen-bloed.at<\/em> damit ich wei\u00df welches Schl\u00fcsselpaar es ist. Als Algorithmus wird ed25519 mit der Standardl\u00e4nge von 256bit verwendet. Den Standardpfad \u00fcberschreibe ich und lege die Dateien im unter Ordner <em>example<\/em> ab. Als <em>passphrase<\/em> kann nichts eingegeben werden, allerdings rate ich davon ab, au\u00dfer der Key wird f\u00fcr automatische Zwecke verwendet zb. Backups erstellen \u00fcber SSH.<br \/>\nAm Ende werden 2 Dateien erstellt &#8222;id_ed25519&#8220; das ist der Private Key der niemals ver\u00f6ffentlicht werden darf und &#8222;id_ed25519.pub&#8220; der Public Key dieser wird beim SSH Server eingetragen.<\/p>\n<p>Das Eintragen beim SSH Server ist einfaches Copy-Paste des Public Keys in die Datei <em>~\/.ssh\/authorized_keys<\/em>, diese muss die Dateirechte 600 besitzen und muss angelegt werden sollte sie noch nicht existieren.<\/p>\n<p>Der Inhalt der authorized_keys Datei ist in diesem Fall:<br \/>\n<code>ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJmaoSAUsWs0fUKPpgDQE0SIWNH\/bbRRyeChQHFhtRKA example@schoen-bloed.at<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Das Erstellen ist sehr einfach, die Wahl des richtigen Verfahrens ist es nicht unbedingt.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,4],"tags":[],"_links":{"self":[{"href":"https:\/\/www.schoen-bloed.at\/blog\/wp-json\/wp\/v2\/posts\/462"}],"collection":[{"href":"https:\/\/www.schoen-bloed.at\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.schoen-bloed.at\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.schoen-bloed.at\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.schoen-bloed.at\/blog\/wp-json\/wp\/v2\/comments?post=462"}],"version-history":[{"count":6,"href":"https:\/\/www.schoen-bloed.at\/blog\/wp-json\/wp\/v2\/posts\/462\/revisions"}],"predecessor-version":[{"id":599,"href":"https:\/\/www.schoen-bloed.at\/blog\/wp-json\/wp\/v2\/posts\/462\/revisions\/599"}],"wp:attachment":[{"href":"https:\/\/www.schoen-bloed.at\/blog\/wp-json\/wp\/v2\/media?parent=462"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.schoen-bloed.at\/blog\/wp-json\/wp\/v2\/categories?post=462"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.schoen-bloed.at\/blog\/wp-json\/wp\/v2\/tags?post=462"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}