{"id":9651,"date":"2018-02-05T20:10:10","date_gmt":"2018-02-05T19:10:10","guid":{"rendered":"http:\/\/blog.wenzlaff.de\/?p=9651"},"modified":"2023-08-20T14:55:20","modified_gmt":"2023-08-20T12:55:20","slug":"was-ist-mit-git-push-github-mit-two-factor-authentication-2fa-anders-oder-warum-laeuft-die-git-unterstuezung-in-nodered-nicht","status":"publish","type":"post","link":"http:\/\/blog.wenzlaff.de\/?p=9651","title":{"rendered":"Was ist mit Git push Github mit Two-factor Authentication (2FA) anders? Oder warum l\u00e4uft die Git unterst\u00fczung in NodeRED nicht?"},"content":{"rendered":"<p>Bisher konnte immer von der Komandozeile von einem Raspberry Pi die Dateien mit Git nach GitHub \u00fcbertragen werden. Das schlug pl\u00f6tzlich fehl, und es wurden nicht sagende \t<strong>user.failed_login<\/strong> Fehlermeldungen im GitHub Account unter Security history angezeigt.<\/p>\n<p><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/01\/GIT-top-6.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/01\/GIT-top-6.png\" alt=\"\" width=\"2732\" height=\"2048\" class=\"aligncenter size-full wp-image-9615\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/01\/GIT-top-6.png 2732w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/01\/GIT-top-6-300x225.png 300w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/01\/GIT-top-6-768x576.png 768w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/01\/GIT-top-6-1024x768.png 1024w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/p>\n<p>Da musst ich aber einiges ausprobieren, bis ich die Aktivierung der &#8222;<strong>Two-factor Authentication<\/strong>&#8220; vor ein paar Tagen mit diesem Fehler in Zusammenhang bringen konnte. Es gibt da auch die Seite <a href=\"https:\/\/docs.github.com\/en\/authentication\/keeping-your-account-and-data-secure\/managing-your-personal-access-tokens\" rel=\"noopener noreferrer\" target=\"_blank\">Creating a personal access token for the command line<\/a> und <a href=\"https:\/\/docs.github.com\/en\/authentication\/securing-your-account-with-two-factor-authentication-2fa\/accessing-github-using-two-factor-authentication\" rel=\"noopener noreferrer\" target=\"_blank\">die<\/a> wo es ganz unten steht.<\/p>\n<p>Also wenn die &#8222;<strong>Two-factor Authentication<\/strong>&#8220; aktivert ist, geht die \u00dcbertragung nicht mehr mit dem User und Passwort sondern mit einem <strong>User Token<\/strong>, denn man auf der Seite &#8222;Developer Settings&#8220; erzeugen muss:<\/p>\n<p><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/02\/Bildschirmfoto-2018-02-05-um-19.04.25.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/02\/Bildschirmfoto-2018-02-05-um-19.04.25.png\" alt=\"\" width=\"979\" height=\"298\" class=\"aligncenter size-full wp-image-9652\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/02\/Bildschirmfoto-2018-02-05-um-19.04.25.png 979w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/02\/Bildschirmfoto-2018-02-05-um-19.04.25-300x91.png 300w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/02\/Bildschirmfoto-2018-02-05-um-19.04.25-768x234.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/p>\n<p>Der generierte Token kann oder besser gesagt <strong>muss<\/strong> dann anstatt des Passwortes verwendet werden. Wenn man den Token nicht immer neu eingeben will, kann man den auch cachen mit:<\/p>\n<pre class=\"lang:default decode:true \" >\r\n# aktiviert den Cache f\u00fcr default 15 Minuten\r\ngit config --global credential.helper cache\r\n\r\n# aktiviert Cache f\u00fcr 1 Stunde, timeout ist die Zeit in Sekunden\r\ngit config --global credential.helper 'cache --timeout=3600'\r\n<\/pre>\n<p> <!--more--><\/p>\n<p>Man kann auch mehrere Token erzeugen, muss sich aber den nur einmal angezeigten Wert sicher wegspeichern, sonst ist er nicht mehr sichtbar. Auch die Rechte kann man f\u00fcr den Token wie gew\u00fcnscht setzten. Z.B.<\/p>\n<p><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/02\/Bildschirmfoto-2018-02-05-um-19.09.28.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/02\/Bildschirmfoto-2018-02-05-um-19.09.28.png\" alt=\"\" width=\"1327\" height=\"1150\" class=\"aligncenter size-full wp-image-9653\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/02\/Bildschirmfoto-2018-02-05-um-19.09.28.png 1327w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/02\/Bildschirmfoto-2018-02-05-um-19.09.28-300x260.png 300w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/02\/Bildschirmfoto-2018-02-05-um-19.09.28-768x666.png 768w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/02\/Bildschirmfoto-2018-02-05-um-19.09.28-1024x887.png 1024w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/p>\n<p>Warum das Commit \u00fcber die NodeRED Gui nicht l\u00e4uft, muss ich mal sp\u00e4ter schauen. \u00dcber die Kommandozeile l\u00e4uft es ja, und evl. ist die NodeRED Version 0.18.1 noch buggy, ist ja auch noch Beta und muss manuell \u00fcber die <strong>.node-red\/settings.js<\/strong> aktiviert werden mit der folgenden Erg\u00e4nzung:<\/p>\n<pre class=\"lang:default decode:true \" >\r\n# am ende mit , anf\u00fcgen\r\neditorTheme: {\r\n\tprojects: {\r\n\t\tenabled: true\t\t\t\r\n\t}\r\n}<\/pre>\n<p>Ist aber auf jeden Fall super die Projekt Verwaltung mit Git in NodeRED. Hat jemand von Euch \u00fcber die NodeRED GUI einen git push \u00fcber ssh hinbekommen mit aktivierter 2FA? Dann mal bitte einen Kommentar hinterlassen. <\/p>\n<p><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/02\/Bildschirmfoto-2018-02-05-um-19.45.08.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/02\/Bildschirmfoto-2018-02-05-um-19.45.08.png\" alt=\"\" width=\"2117\" height=\"916\" class=\"aligncenter size-full wp-image-9654\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/02\/Bildschirmfoto-2018-02-05-um-19.45.08.png 2117w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/02\/Bildschirmfoto-2018-02-05-um-19.45.08-300x130.png 300w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/02\/Bildschirmfoto-2018-02-05-um-19.45.08-768x332.png 768w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2018\/02\/Bildschirmfoto-2018-02-05-um-19.45.08-1024x443.png 1024w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Bisher konnte immer von der Komandozeile von einem Raspberry Pi die Dateien mit Git nach GitHub \u00fcbertragen werden. Das schlug pl\u00f6tzlich fehl, und es wurden nicht sagende user.failed_login Fehlermeldungen im GitHub Account unter Security history angezeigt. Da musst ich aber einiges ausprobieren, bis ich die Aktivierung der &#8222;Two-factor Authentication&#8220; vor ein paar Tagen mit diesem &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/blog.wenzlaff.de\/?p=9651\" class=\"more-link\"><span class=\"screen-reader-text\">\u201eWas ist mit Git push Github mit Two-factor Authentication (2FA) anders? Oder warum l\u00e4uft die Git unterst\u00fczung in NodeRED nicht?\u201c <\/span>weiterlesen<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[220,79,1023,1319],"tags":[3135,325,324,740,3133,3134,3136],"class_list":["post-9651","post","type-post","status-publish","format-standard","hentry","category-anleitung","category-programmierung","category-raspberry-pi","category-sicherheit-2","tag-2fa","tag-git","tag-github","tag-ssh","tag-token","tag-two-factor-authentication","tag-zwei-faktoren"],"_links":{"self":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/posts\/9651","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9651"}],"version-history":[{"count":0,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/posts\/9651\/revisions"}],"wp:attachment":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9651"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9651"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9651"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}