{"id":4956,"date":"2026-09-17T08:00:00","date_gmt":"2026-09-17T08:00:00","guid":{"rendered":"https:\/\/netguide.io\/linux\/?p=4956"},"modified":"2026-08-10T23:46:04","modified_gmt":"2026-08-10T23:46:04","slug":"ssh-config-datei-verbindungen-vereinfachen","status":"publish","type":"post","link":"https:\/\/netguide.io\/linux\/de\/ssh-config-datei-verbindungen-vereinfachen\/","title":{"rendered":"SSH vereinfachen mit der ~\/.ssh\/config-Datei"},"content":{"rendered":"<script type=\"text\/plain\" data-tcf=\"waiting-for-consent\" data-id=\"4797\" data-bid=\"2\" data-placement=\"4798\">PGRpdiBpZD0ibmV0Z3VpZGVhLTQyOTAwNzk3NTMiIGNsYXNzPSJuZXRndWlkZWEtYmVmb3JlLWNvbnRlbnQgbmV0Z3VpZGVhLWVudGl0eS1wbGFjZW1lbnQiPjxkaXYgY2xhc3M9Im5ldGd1aWRlYS1hZGxhYmVsIj5BZHZlcnRpc2VtZW50czwvZGl2PjxzY3JpcHQgYXN5bmMgc3JjPSIvL3BhZ2VhZDIuZ29vZ2xlc3luZGljYXRpb24uY29tL3BhZ2VhZC9qcy9hZHNieWdvb2dsZS5qcz9jbGllbnQ9Y2EtcHViLTYyNTg1NTYyNTcyNDU5OTgiIGNyb3Nzb3JpZ2luPSJhbm9ueW1vdXMiPjwvc2NyaXB0PjxpbnMgY2xhc3M9ImFkc2J5Z29vZ2xlIiBzdHlsZT0iZGlzcGxheTpibG9jazsiIGRhdGEtYWQtY2xpZW50PSJjYS1wdWItNjI1ODU1NjI1NzI0NTk5OCIgCmRhdGEtYWQtc2xvdD0iMzQ5NDExNTM0MiIgCmRhdGEtYWQtZm9ybWF0PSJhdXRvIj48L2lucz4KPHNjcmlwdD4gCihhZHNieWdvb2dsZSA9IHdpbmRvdy5hZHNieWdvb2dsZSB8fCBbXSkucHVzaCh7fSk7IAo8L3NjcmlwdD4KPC9kaXY+<\/script>\n<p class=\"wp-block-paragraph\">Tippst du bei jedem Login lange Befehle wie <code>ssh -p 2222 tobias@192.168.1.50 -i ~\/.ssh\/id_server<\/code>? Das geht einfacher. Mit der <strong>SSH-config-Datei<\/strong> hinterlegst du deine Server einmal und verbindest dich dann mit einem kurzen Namen. In dieser Anleitung richtest du <code>~\/.ssh\/config<\/code> ein und lernst die wichtigsten Optionen.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Die <strong>SSH-config-Datei<\/strong> unter <code>~\/.ssh\/config<\/code> ist einer der gr\u00f6\u00dften Produktivit\u00e4ts-Booster f\u00fcr alle, die regelm\u00e4\u00dfig mit mehreren Servern arbeiten. Statt dir Ports, Benutzernamen, IP-Adressen und Schl\u00fcsselpfade zu merken, definierst du \u00fcbersichtliche Profile und verbindest dich mit einem kurzen Alias. In diesem Artikel schaust du dir nach den Grundlagen auch fortgeschrittene Optionen, Sicherheitsaspekte und die Fehlersuche an.<\/p>\n\n\n\t\t\t\t<div class=\"wp-block-uagb-table-of-contents uagb-toc__align-left uagb-toc__columns-1  uagb-block-1ffd1ad5      \"\n\t\t\t\t\tdata-scroll= \"1\"\n\t\t\t\t\tdata-offset= \"30\"\n\t\t\t\t\tstyle=\"\"\n\t\t\t\t>\n\t\t\t\t<div class=\"uagb-toc__wrap\">\n\t\t\t\t\t\t<div class=\"uagb-toc__title\">\n\t\t\t\t\t\t\tInhaltsverzeichnis\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"uagb-toc__list-wrap \">\n\t\t\t\t\t\t<ol class=\"uagb-toc__list\"><li class=\"uagb-toc__list\"><a href=\"#was-ist-die-ssh-config\" class=\"uagb-toc-link__trigger\">Was ist die SSH-config?<\/a><li class=\"uagb-toc__list\"><a href=\"#ein-erstes-profil-anlegen\" class=\"uagb-toc-link__trigger\">Ein erstes Profil anlegen<\/a><li class=\"uagb-toc__list\"><a href=\"#die-wichtigsten-optionen\" class=\"uagb-toc-link__trigger\">Die wichtigsten Optionen<\/a><li class=\"uagb-toc__list\"><a href=\"#mehrere-server-und-platzhalter\" class=\"uagb-toc-link__trigger\">Mehrere Server und Platzhalter<\/a><li class=\"uagb-toc__list\"><a href=\"#\u00fcber-einen-sprungserver-verbinden-proxyjump\" class=\"uagb-toc-link__trigger\">\u00dcber einen Sprungserver verbinden (ProxyJump)<\/a><li class=\"uagb-toc__list\"><a href=\"#n\u00fctzliche-optionen-f\u00fcr-stabile-und-schnelle-verbindungen\" class=\"uagb-toc-link__trigger\">N\u00fctzliche Optionen f\u00fcr stabile und schnelle Verbindungen<\/a><li class=\"uagb-toc__list\"><a href=\"#sicherheit-was-in-die-config-geh\u00f6rt-und-was-nicht\" class=\"uagb-toc-link__trigger\">Sicherheit: Was in die config geh\u00f6rt \u2013 und was nicht<\/a><li class=\"uagb-toc__list\"><a href=\"#h\u00e4ufige-fehler-und-fehlersuche\" class=\"uagb-toc-link__trigger\">H\u00e4ufige Fehler und Fehlersuche<\/a><li class=\"uagb-toc__list\"><a href=\"#h\u00e4ufige-fragen\" class=\"uagb-toc-link__trigger\">H\u00e4ufige Fragen<\/a><li class=\"uagb-toc__list\"><a href=\"#gilt-die-config-auch-f\u00fcr-scp-rsync-und-git\" class=\"uagb-toc-link__trigger\">Gilt die config auch f\u00fcr scp, rsync und git?<\/a><li class=\"uagb-toc__list\"><a href=\"#spielt-die-reihenfolge-der-host-eintr\u00e4ge-eine-rolle\" class=\"uagb-toc-link__trigger\">Spielt die Reihenfolge der Host-Eintr\u00e4ge eine Rolle?<\/a><li class=\"uagb-toc__list\"><a href=\"#wie-setze-ich-globale-standardwerte-f\u00fcr-alle-server\" class=\"uagb-toc-link__trigger\">Wie setze ich globale Standardwerte f\u00fcr alle Server?<\/a><li class=\"uagb-toc__list\"><a href=\"#fazit\" class=\"uagb-toc-link__trigger\">Fazit<\/a><\/ol>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Was ist die SSH-config?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Die Datei <code>~\/.ssh\/config<\/code> auf deinem lokalen Rechner speichert Verbindungsprofile. Statt alle Parameter im Befehl anzugeben, definierst du sie einmal pro Server. Das spart Tipparbeit und macht komplexe Zug\u00e4nge \u00fcbersichtlich.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">Ein erstes Profil anlegen<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Erstelle oder \u00f6ffne die Datei und lege einen Eintrag an:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#24292e\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>nano ~\/.ssh\/config<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #B392F0\">nano<\/span><span style=\"color: #9ECBFF\"> ~\/.ssh\/config<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#24292e\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>Host server\n    HostName 192.168.1.50\n    User tobias\n    Port 2222\n    IdentityFile ~\/.ssh\/id_server<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #E1E4E8\">Host server<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">    HostName 192.168.1.50<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">    User tobias<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">    Port 2222<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">    IdentityFile ~\/.ssh\/id_server<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Ab jetzt gen\u00fcgt ein kurzer Befehl \u2013 SSH erg\u00e4nzt Benutzer, Port und Schl\u00fcssel automatisch:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#24292e\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>ssh server<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #B392F0\">ssh<\/span><span style=\"color: #9ECBFF\"> server<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Den passenden Schl\u00fcssel erzeugst und hinterlegst du wie in <a href=\"https:\/\/netguide.io\/linux\/de\/ssh-key-auf-einem-linux-server-hinterlegen\/\">SSH-Key hinterlegen<\/a> beschrieben.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">Die wichtigsten Optionen<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Option<\/th><th>Bedeutung<\/th><\/tr><\/thead><tbody><tr><td><code>Host<\/code><\/td><td>Der Kurzname, den du beim Verbinden nutzt<\/td><\/tr><tr><td><code>HostName<\/code><\/td><td>Die echte Adresse oder IP des Servers<\/td><\/tr><tr><td><code>User<\/code><\/td><td>Der Benutzername f\u00fcr den Login<\/td><\/tr><tr><td><code>Port<\/code><\/td><td>Der SSH-Port (falls abweichend von 22)<\/td><\/tr><tr><td><code>IdentityFile<\/code><\/td><td>Der zu verwendende private Schl\u00fcssel<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">Mehrere Server und Platzhalter<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Du kannst beliebig viele <code>Host<\/code>-Bl\u00f6cke anlegen. Gemeinsame Einstellungen fasst du \u00fcber einen Platzhalter zusammen. Dieser Block gilt f\u00fcr alle Verbindungen:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#24292e\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>Host *\n    ServerAliveInterval 60\n    AddKeysToAgent yes<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #E1E4E8\">Host *<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">    ServerAliveInterval 60<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">    AddKeysToAgent yes<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u00dcber einen Sprungserver verbinden (ProxyJump)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Ist ein Server nur \u00fcber einen anderen erreichbar, erledigt <code>ProxyJump<\/code> das automatisch \u2013 kein manuelles Durchhangeln mehr:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#24292e\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" style=\"color:#e1e4e8;display:none\" aria-label=\"Copy\" class=\"code-block-pro-copy-button\"><pre class=\"code-block-pro-copy-button-pre\" aria-hidden=\"true\"><textarea class=\"code-block-pro-copy-button-textarea\" tabindex=\"-1\" aria-hidden=\"true\" readonly>Host intern\n    HostName 10.0.0.10\n    User tobias\n    ProxyJump server<\/textarea><\/pre><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki github-dark\" style=\"background-color: #24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #E1E4E8\">Host intern<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">    HostName 10.0.0.10<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">    User tobias<\/span><\/span>\n<span class=\"line\"><span style=\"color: #E1E4E8\">    ProxyJump server<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">N\u00fctzliche Optionen f\u00fcr stabile und schnelle Verbindungen<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Neben den Basics gibt es einige Optionen, die deinen Alltag sp\u00fcrbar angenehmer machen. Besonders praktisch ist das Verbindungs-Multiplexing: Damit wird f\u00fcr mehrere Sitzungen zum selben Host nur ein einziger TCP-Kanal aufgebaut, was neue Verbindungen fast verz\u00f6gerungsfrei \u00f6ffnet. In Kombination mit <code>ServerAliveInterval<\/code> bleibt deine Sitzung auch bei kurzer Inaktivit\u00e4t bestehen.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Option<\/th><th>Zweck<\/th><\/tr><\/thead><tbody><tr><td><code>ServerAliveInterval 60<\/code><\/td><td>Verhindert Timeout durch Keepalive-Pakete<\/td><\/tr><tr><td><code>Compression yes<\/code><\/td><td>Spart Bandbreite bei langsamer Leitung<\/td><\/tr><tr><td><code>ControlMaster auto<\/code><\/td><td>Multiplexing mehrerer Sitzungen<\/td><\/tr><tr><td><code>ControlPersist 10m<\/code><\/td><td>H\u00e4lt den Master-Kanal offen<\/td><\/tr><tr><td><code>ForwardAgent yes<\/code><\/td><td>Reicht den SSH-Agent weiter (mit Bedacht)<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">F\u00fcr das Multiplexing erg\u00e4nzt du zus\u00e4tzlich einen Pfad f\u00fcr den Socket, etwa <code>ControlPath ~\/.ssh\/sockets\/%r@%h:%p<\/code>. Lege das Verzeichnis vorher mit <code>mkdir -p ~\/.ssh\/sockets<\/code> an.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Ein weiterer Alltagshelfer sind Platzhalter in Verbindung mit <code>ProxyJump<\/code> und <code>RemoteCommand<\/code>. Musst du dich zum Beispiel immer \u00fcber denselben Sprungserver zu einer ganzen Serverfamilie verbinden, definierst du den Jump-Host einmal und referenzierst ihn per <code>ProxyJump bastion<\/code> in allen betroffenen Bl\u00f6cken. Die Token <code>%h<\/code> (Hostname), <code>%p<\/code> (Port) und <code>%r<\/code> (Remote-User) machen deine Eintr\u00e4ge dabei generisch, sodass ein einziger Block mit <code>Host *.intern<\/code> f\u00fcr dutzende Server ausreicht.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">Sicherheit: Was in die config geh\u00f6rt \u2013 und was nicht<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Die config-Datei selbst enth\u00e4lt keine Passw\u00f6rter, trotzdem lohnt ein sicherheitsbewusster Umgang. Setze die Dateirechte mit <code>chmod 600 ~\/.ssh\/config<\/code>, damit kein anderer Nutzer deine Serverliste einsehen kann. Verzichte darauf, <code>StrictHostKeyChecking no<\/code> global zu setzen \u2013 das \u00f6ffnet T\u00fcr und Tor f\u00fcr Man-in-the-Middle-Angriffe. Nutze stattdessen konsequent Schl\u00fcssel statt Passw\u00f6rter und verweise per <code>IdentityFile<\/code> gezielt auf den passenden Key.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Rechte setzen:<\/strong> <code>chmod 600 ~\/.ssh\/config<\/code> und <code>700<\/code> f\u00fcr <code>~\/.ssh<\/code><\/li>\n\n<li><strong>Keys statt Passw\u00f6rter:<\/strong> pro Host ein <code>IdentityFile<\/code> und <code>IdentitiesOnly yes<\/code><\/li>\n\n<li><strong>Agent-Forwarding sparsam:<\/strong> nur f\u00fcr vertrauensw\u00fcrdige Hosts aktivieren<\/li>\n\n<li><strong>Host-Keys pr\u00fcfen:<\/strong> <code>StrictHostKeyChecking<\/code> nicht deaktivieren<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Wie du deinen Schl\u00fcssel korrekt auf dem Server ablegst, zeigt dir die Anleitung zum <a href=\"https:\/\/netguide.io\/linux\/de\/ssh-key-auf-einem-linux-server-hinterlegen\/\">SSH-Key hinterlegen<\/a>.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">H\u00e4ufige Fehler und Fehlersuche<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Funktioniert eine Verbindung nicht wie erwartet, hilft der ausf\u00fchrliche Modus: Mit <code>ssh -v deinserver<\/code> siehst du genau, welche config-Zeilen geladen und welcher Schl\u00fcssel angeboten wird. Ein h\u00e4ufiger Stolperstein sind zu offene Dateirechte \u2013 SSH ignoriert dann still deinen Schl\u00fcssel. Auch die Reihenfolge der Bl\u00f6cke ist wichtig: Bei mehreren passenden <code>Host<\/code>-Eintr\u00e4gen gewinnt f\u00fcr jede Option der erste Treffer von oben.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Reicht dir <code>-v<\/code> nicht aus, steigern <code>-vv<\/code> und <code>-vvv<\/code> die Detailtiefe weiter, bis hin zum vollst\u00e4ndigen Aushandeln der Verschl\u00fcsselung. Willst du pr\u00fcfen, welche Werte SSH f\u00fcr einen bestimmten Host tats\u00e4chlich zusammensetzt, ohne dich zu verbinden, nutzt du <code>ssh -G deinserver<\/code>. Der Befehl gibt die komplette, aufgel\u00f6ste Konfiguration aus \u2013 ideal, um Tippfehler oder \u00fcberschriebene Optionen aufzusp\u00fcren, bevor du dich mit deinem <a href=\"https:\/\/netguide.io\/linux\/de\/ssh-server-absichern\/\">abgesicherten Server<\/a> verbindest.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">H\u00e4ufige Fragen<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">Gilt die config auch f\u00fcr scp, rsync und git?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Ja. Alle Tools, die intern OpenSSH nutzen \u2013 darunter <code>scp<\/code>, <code>sftp<\/code>, <code>rsync<\/code> und <code>git<\/code> \u00fcber SSH \u2013 lesen dieselbe <code>~\/.ssh\/config<\/code>. Du kannst also nach dem Anlegen eines Profils direkt <code>rsync -av daten\/ meinserver:\/backup\/<\/code> nutzen.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Spielt die Reihenfolge der Host-Eintr\u00e4ge eine Rolle?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Ja, und zwar entscheidend. SSH wertet die Datei von oben nach unten aus und \u00fcbernimmt f\u00fcr jede Option den ersten passenden Wert. Spezifische Hosts geh\u00f6ren daher nach oben, allgemeine Muster wie <code>Host *<\/code> ans Ende der Datei.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Wie setze ich globale Standardwerte f\u00fcr alle Server?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Nutze am Ende der Datei einen Block <code>Host *<\/code>. Optionen dort greifen f\u00fcr alle Verbindungen, sofern sie nicht vorher schon durch einen spezifischeren Host-Eintrag gesetzt wurden \u2013 ideal f\u00fcr <code>ServerAliveInterval<\/code> oder <code>Compression<\/code>.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">Fazit<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Die <code>~\/.ssh\/config<\/code> macht aus kryptischen Befehlen kurze, merkbare Namen \u2013 und mit <code>ProxyJump<\/code> werden selbst verschachtelte Zug\u00e4nge zum Einzeiler. Einmal eingerichtet, willst du nie wieder darauf verzichten. Wie du die Gegenstelle absicherst, zeigt <a href=\"https:\/\/netguide.io\/linux\/de\/ssh-server-absichern\/\">SSH-Server absichern<\/a>.<\/p>\n<script type=\"text\/plain\" data-tcf=\"waiting-for-consent\" data-id=\"4799\" data-bid=\"2\" data-placement=\"4800\">PGRpdiBpZD0ibmV0Z3VpZGVhLTExMDIzNDg5OTciIGNsYXNzPSJuZXRndWlkZWEtYWZ0ZXItY29udGVudCBuZXRndWlkZWEtZW50aXR5LXBsYWNlbWVudCI+PGRpdiBjbGFzcz0ibmV0Z3VpZGVhLWFkbGFiZWwiPkFkdmVydGlzZW1lbnRzPC9kaXY+PHNjcmlwdCBhc3luYyBzcmM9Ii8vcGFnZWFkMi5nb29nbGVzeW5kaWNhdGlvbi5jb20vcGFnZWFkL2pzL2Fkc2J5Z29vZ2xlLmpzP2NsaWVudD1jYS1wdWItNjI1ODU1NjI1NzI0NTk5OCIgY3Jvc3NvcmlnaW49ImFub255bW91cyI+PC9zY3JpcHQ+PGlucyBjbGFzcz0iYWRzYnlnb29nbGUiIHN0eWxlPSJkaXNwbGF5OmJsb2NrOyIgZGF0YS1hZC1jbGllbnQ9ImNhLXB1Yi02MjU4NTU2MjU3MjQ1OTk4IiAKZGF0YS1hZC1zbG90PSI0NTU5Nzg1MDAyIiAKZGF0YS1hZC1mb3JtYXQ9ImF1dG8iPjwvaW5zPgo8c2NyaXB0PiAKKGFkc2J5Z29vZ2xlID0gd2luZG93LmFkc2J5Z29vZ2xlIHx8IFtdKS5wdXNoKHt9KTsgCjwvc2NyaXB0Pgo8L2Rpdj4=<\/script>","protected":false},"excerpt":{"rendered":"<p>Die SSH-config-Datei nutzen: Server unter kurzen Namen verbinden, Benutzer, Port und Key hinterlegen und mit ProxyJump bequem \u00fcber Sprungserver zugreifen.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[9],"tags":[],"class_list":["post-4956","post","type-post","status-publish","format-standard","hentry","category-linux"],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"Tobias","author_link":"https:\/\/netguide.io\/linux\/author\/tobias-pries\/"},"uagb_comment_info":0,"uagb_excerpt":"Die SSH-config-Datei nutzen: Server unter kurzen Namen verbinden, Benutzer, Port und Key hinterlegen und mit ProxyJump bequem \u00fcber Sprungserver zugreifen.","brizy_media":[],"_links":{"self":[{"href":"https:\/\/netguide.io\/linux\/wp-json\/wp\/v2\/posts\/4956","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/netguide.io\/linux\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/netguide.io\/linux\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/netguide.io\/linux\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/netguide.io\/linux\/wp-json\/wp\/v2\/comments?post=4956"}],"version-history":[{"count":1,"href":"https:\/\/netguide.io\/linux\/wp-json\/wp\/v2\/posts\/4956\/revisions"}],"predecessor-version":[{"id":4988,"href":"https:\/\/netguide.io\/linux\/wp-json\/wp\/v2\/posts\/4956\/revisions\/4988"}],"wp:attachment":[{"href":"https:\/\/netguide.io\/linux\/wp-json\/wp\/v2\/media?parent=4956"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/netguide.io\/linux\/wp-json\/wp\/v2\/categories?post=4956"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/netguide.io\/linux\/wp-json\/wp\/v2\/tags?post=4956"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}