{"id":9250,"date":"2026-10-20T07:54:40","date_gmt":"2026-10-20T06:54:40","guid":{"rendered":"https:\/\/workboot.fr\/ciela\/?page_id=9250"},"modified":"2026-10-21T17:34:10","modified_gmt":"2026-10-21T16:34:10","slug":"cles-publique-privee","status":"publish","type":"page","link":"https:\/\/workboot.fr\/ciela\/cles-publique-privee\/","title":{"rendered":"Cl\u00e9s publique\/priv\u00e9e avec ssh"},"content":{"rendered":"\t\t\t\t<div class=\"wp-block-uagb-table-of-contents uagb-toc__align-left uagb-toc__columns-1  uagb-block-27dc89f1      \"\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\tTable des mati\u00e8res\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=\"#pr\u00e9sentation\" class=\"uagb-toc-link__trigger\">Pr\u00e9sentation:<\/a><li class=\"uagb-toc__list\"><a href=\"#les-fichiers\" class=\"uagb-toc-link__trigger\">Les fichiers<\/a><li class=\"uagb-toc__list\"><a href=\"#ssh-keygen\" class=\"uagb-toc-link__trigger\">ssh-keygen<\/a><ul class=\"uagb-toc__list\"><li class=\"uagb-toc__list\"><a href=\"#la-cl\u00e9-publique\" class=\"uagb-toc-link__trigger\">la cl\u00e9 publique<\/a><ul class=\"uagb-toc__list\"><li class=\"uagb-toc__list\"><a href=\"#une-autre-fa\u00e7on-dutiliser-ssh-keygen-avec-les-options-lf\" class=\"uagb-toc-link__trigger\">une autre fa\u00e7on d&#039;utiliser ssh-keygen avec les options -lf<\/a><li class=\"uagb-toc__list\"><li class=\"uagb-toc__list\"><a href=\"#un-hash-de-la-cl\u00e9-publique\" class=\"uagb-toc-link__trigger\">un hash de la cl\u00e9 publique<\/a><li class=\"uagb-toc__list\"><li class=\"uagb-toc__list\"><a href=\"#la-cl\u00e9-publique-peut-\u00eatre-r\u00e9g\u00e9n\u00e9r\u00e9e-\u00e0-partir-de-la-cl\u00e9-priv\u00e9e-avec-loption-y\" class=\"uagb-toc-link__trigger\">la cl\u00e9 publique peut \u00eatre r\u00e9g\u00e9n\u00e9r\u00e9e \u00e0 partir de la cl\u00e9 priv\u00e9e. avec l&#039;option -y<\/a><li class=\"uagb-toc__list\"><li class=\"uagb-toc__list\"><a href=\"#refaire-le-randomart-lv\" class=\"uagb-toc-link__trigger\">refaire le  randomart  -lv<\/a><\/li><\/ul><li class=\"uagb-toc__list\"><a href=\"#la-passphrase-ce-qui-est-plus-que-conseill\u00e9e-on-utilise-plus-loption-n\" class=\"uagb-toc-link__trigger\">la passphrase , ce qui est plus que conseill\u00e9e , on utilise plus l&#039;option -N &quot;&quot;<\/a><ul class=\"uagb-toc__list\"><li class=\"uagb-toc__list\"><a href=\"#modifier-la-passphrase-option-p\" class=\"uagb-toc-link__trigger\">Modifier la passphrase  , option -p<\/a><li class=\"uagb-toc__list\"><li class=\"uagb-toc__list\"><a href=\"#on-peut-v\u00e9rifier-la-passphrase\" class=\"uagb-toc-link__trigger\">on peut v\u00e9rifier la passphrase<\/a><\/li><\/ul><li class=\"uagb-toc__list\"><a href=\"#la-cl\u00e9-priv\u00e9e-ne-doit-jamais-\u00eatre-diffus\u00e9e\" class=\"uagb-toc-link__trigger\">la cl\u00e9 priv\u00e9e ne doit jamais \u00eatre diffus\u00e9e !<\/a><\/li><\/ul><\/li><li class=\"uagb-toc__list\"><a href=\"#ssh-copy-id\" class=\"uagb-toc-link__trigger\">ssh-copy-id<\/a><li class=\"uagb-toc__list\"><a href=\"#ssh\" class=\"uagb-toc-link__trigger\">ssh<\/a><ul class=\"uagb-toc__list\"><li class=\"uagb-toc__list\"><a href=\"#usage-classique-en-terminal\" class=\"uagb-toc-link__trigger\">usage classique en terminal<\/a><ul class=\"uagb-toc__list\"><li class=\"uagb-toc__list\"><a href=\"#verbose-loption-v-debug\" class=\"uagb-toc-link__trigger\">verbose l&#039;option -v (debug)<\/a><li class=\"uagb-toc__list\"><li class=\"uagb-toc__list\"><a href=\"#avec-ssh-on-peut-juste-faire-une-commande\" class=\"uagb-toc-link__trigger\">avec ssh on peut juste faire une commande<\/a><\/li><\/ul><\/li><\/ul><\/li><\/ul><\/li><li class=\"uagb-toc__list\"><a href=\"#ssh-agent\" class=\"uagb-toc-link__trigger\">ssh-agent<\/a><li class=\"uagb-toc__list\"><a href=\"#ssh-add\" class=\"uagb-toc-link__trigger\">ssh-add<\/a><\/ul><\/ul><\/ul><\/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<h2 class=\"wp-block-heading\">Pr\u00e9sentation:<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Analogie simple<\/strong> :<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Mot de passe = frapper \u00e0 la porte et donner un mot \u2192 vuln\u00e9rable (\u00e9coute, devinette)<\/li>\n\n\n\n<li>Cl\u00e9 SSH = serrure \u00e0 double cl\u00e9 : une cl\u00e9 <strong>priv\u00e9e<\/strong> (gard\u00e9e secr\u00e8te, comme votre cl\u00e9 de maison) et une cl\u00e9 <strong>publique<\/strong> (le cadenas qu&rsquo;on donne \u00e0 qui veut vous laisser entrer)<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Points cl\u00e9s \u00e0 expliquer :<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Asym\u00e9trie<\/strong> : ce qui est chiffr\u00e9 avec la cl\u00e9 publique ne peut \u00eatre d\u00e9chiffr\u00e9 qu&rsquo;avec la priv\u00e9e (et inversement pour la signature)<\/li>\n\n\n\n<li>La cl\u00e9 publique <strong>ne craint rien<\/strong> \u00e0 \u00eatre partag\u00e9e (GitHub, serveur, etc.)<\/li>\n\n\n\n<li>La cl\u00e9 priv\u00e9e <strong>ne sort JAMAIS<\/strong> de la machine (prot\u00e9g\u00e9e par une passphrase)<\/li>\n\n\n\n<li>Formats : RSA (legacy), <strong>Ed25519<\/strong> (recommand\u00e9 aujourd&rsquo;hui), ECDSA<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Les fichiers<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>etudiant@ordi:~$ ls\nArduino  Documents  Mod\u00e8les  Public  T\u00e9l\u00e9chargements  Works\nBureau   Images     Musique  Softs   Vid\u00e9os           snap\netudiant@ordi:~$ ls .ssh\/\nauthorized_keys  id_ed25519  id_ed25519.pub  known_hosts\netudiant@ordi:~$ ls ~\/.ssh\/\nauthorized_keys  id_ed25519  id_ed25519.pub  known_hosts\netudiant@ordi:~$ <\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>id_ed25519<\/strong> : cl\u00e9 priv\u00e9e (<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">ne jamais d\u00e9voiler<\/mark>)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>id_ed25519.pub<\/strong> : cl\u00e9 publique (\u00e0 partager)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>known_host<\/strong>s : Cl\u00e9s publiques des serveurs d\u00e9j\u00e0 visit\u00e9s par cette machine (= les \u00ab visit\u00e9s \u00bb), h\u00f4tes connus<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>authorized_keys<\/strong> : Cl\u00e9s publiques d&rsquo;utilisateurs autoris\u00e9s \u00e0 se connecter sur la machine locale.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">ssh-keygen<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><code>ssh-keygen<\/code><\/strong> est l&rsquo;utilitaire en ligne de commande du paquet <strong>OpenSSH<\/strong> qui sert \u00e0 <strong>g\u00e9n\u00e9rer, inspecter, modifier et convertir les cl\u00e9s cryptographiques<\/strong> utilis\u00e9es par SSH. C&rsquo;est l&rsquo;outil qui cr\u00e9e la paire <strong>cl\u00e9 priv\u00e9e \/ cl\u00e9 publique<\/strong>, et qui permet ensuite de g\u00e9rer sa passphrase, son format, son empreinte, etc.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">ici on utilise un r\u00e9pertoire test_ssh et des fichiers test_ssh  avec l&rsquo;option -f (file) -N  \u00ab\u00a0\u00a0\u00bb pour aucun mot de passe pour simplifier.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">si on ne pr\u00e9cise pas l&rsquo;option -f le r\u00e9sultat va directement dans ~\/.ssh =&gt; id_ed25519.pub et id_ed25519<\/mark><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wb2g1app14@ordi:~$ mkdir test_ssh\nwb2g1app14@ordi:~$ ssh-keygen -t ed25519 -f test_ssh\/test_ssh -N \"\" -C \"demo@ecole.fr\"\nGenerating public\/private ed25519 key pair.\nYour identification has been saved in test_ssh\/test_ssh\nYour public key has been saved in test_ssh\/test_ssh.pub\nThe key fingerprint is:\nSHA256:KSmVW2F3v6Q0zSnAIfJBcplGN11zrlBuJZZSmPNEcgI demo@ecole.fr\nThe key's randomart image is:\n+--&#91;ED25519 256]--+\n<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-green-cyan-color\">|      ooO+E++*X.o|\n|       B+*.+*@oB |\n|      o.o   ==O .|\n|     . + . . B.o |\n|    . + S   . o  |\n|     . .         |\n|                 |\n|                 |\n|                 |<\/mark>\n+----&#91;SHA256]-----+\nwb2g1app14@ordi:~$ \n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">le randomart (en vert) repr\u00e9sentation graphique de l&#8217;empreinte<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">la cl\u00e9 publique <\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>wb2g1app14@ordi:~$ cat ~\/test_ssh\/test_ssh.pub \nssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINnyCbVuFh40oDvCj0mbpZBK6YsQvmKPm3a8Hiqs8Ywc demo@ecole.fr\nwb2g1app14@ordi:~$ \n<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">une autre fa\u00e7on d&rsquo;utiliser ssh-keygen avec les options -lf<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>wb2g1app14@ordi:~$ cat ~\/test_ssh\/test_ssh.pub \nssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINnyCbVuFh40oDvCj0mbpZBK6YsQvmKPm3a8Hiqs8Ywc demo@ecole.fr\nwb2g1app14@ordi:~$ <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-luminous-vivid-orange-color\">ssh-keygen -lf test_ssh\/test_ssh.pub<\/mark>\n256 SHA256:KSmVW2F3v6Q0zSnAIfJBcplGN11zrlBuJZZSmPNEcgI demo@ecole.fr (ED25519)\nwb2g1app14@ordi:~$ \n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">la cl\u00e9 : (fingerprint)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ssh-ed25519  AAAAC3NzaC1lZDI1NTE5AAAAINny...8Ywc  demo@ecole.fr\n\u2514\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2518  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518  \u2514\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2518\n   algorithme          cl\u00e9 publique (base64)       commentaire (-C)\n<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">un hash de la cl\u00e9 publique <\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">L&#8217;empreinte d\u00e9crit la personne, mais ne permet pas de la reconstruire. On peut l&rsquo;afficher au tableau sans risque.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>256  SHA256:KSmVW2F3v6Q0zSnAIfJBcplGN11zrlBuJZZSmPNEcgI  demo@ecole.fr  (ED25519)\n\u2514\u252c\u2518  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518  \u2514\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2518  \u2514\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2518\ntaille                empreinte (hash SHA256)             commentaire     type\n(en bits)                                                 (lu dans le .pub)<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>wb2g1app14@ordi:~$ cat ~\/test_ssh\/test_ssh.pub \nssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINnyCbVuFh40oDvCj0mbpZBK6YsQvmKPm3a8Hiqs8Ywc demo@ecole.fr\nwb2g1app14@ordi:~$ ssh-keygen -lf test_ssh\/test_ssh.pub\n256 SHA256:KSmVW2F3v6Q0zSnAIfJBcplGN11zrlBuJZZSmPNEcgI demo@ecole.fr (ED25519)\nwb2g1app14@ordi:~$ \n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>\ud83d\udd11 Le point crucial : le fingerprint est un hash\nTrois propri\u00e9t\u00e9s qui expliquent tout :\n\nIrr\u00e9versible \u2192 on ne peut pas retrouver la cl\u00e9 \u00e0 partir de l'empreinte.\n\nD\u00e9terministe \u2192 m\u00eame cl\u00e9 \u21d2 toujours m\u00eame empreinte.\n\nDiscriminant \u2192 deux cl\u00e9s diff\u00e9rentes \u21d2 empreintes diff\u00e9rentes (avec une probabilit\u00e9 \u00e9crasante).\n\n\ud83d\udc49 C'est pour \u00e7a que l'empreinte est l'outil de v\u00e9rification : GitHub\/GitLab l'affichent quand vous ajoutez une cl\u00e9, et vous pouvez comparer avec la v\u00f4tre sans jamais partager la cl\u00e9 compl\u00e8te.\n<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">la cl\u00e9 publique peut \u00eatre r\u00e9g\u00e9n\u00e9r\u00e9e \u00e0 partir de la cl\u00e9 priv\u00e9e. avec l&rsquo;option -y<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>wb2g1app14@ordi:~$ rm test_ssh\/test_ssh.pub  # on perd la cl\u00e9 publique !!\nwb2g1app14@ordi:~$ ssh-keygen -y -f test_ssh\/test_ssh &gt; test_ssh\/test_ssh.pub\nwb2g1app14@ordi:~$ cat test_ssh\/test_ssh.pub \nssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINnyCbVuFh40oDvCj0mbpZBK6YsQvmKPm3a8Hiqs8Ywc demo@ecole.fr\nwb2g1app14@ordi:~$ # on a retrouv\u00e9 la cl\u00e9 publique !! OUF\n<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">refaire le  randomart  -lv<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>wb2g1app14@ordi:~$ ssh-keygen -lv -f ~\/test_ssh\/test_ssh.pub\n256 SHA256:KSmVW2F3v6Q0zSnAIfJBcplGN11zrlBuJZZSmPNEcgI demo@ecole.fr (ED25519)\n+--&#91;ED25519 256]--+\n|      ooO+E++*X.o|\n|       B+*.+*@oB |\n|      o.o   ==O .|\n|     . + . . B.o |\n|    . + S   . o  |\n|     . .         |\n|                 |\n|                 |\n|                 |\n+----&#91;SHA256]-----+\nwb2g1app14@ordi:~$ \n<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">la passphrase , ce qui est plus que conseill\u00e9e , on utilise plus l&rsquo;option -N \u00ab\u00a0\u00a0\u00bb<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>wb2g1app14@ordi:~$ ssh-keygen -t ed25519 -f ~\/test_ssh\/cle_protegee -C \"caroline@dorian.fr\"\nGenerating public\/private ed25519 key pair.\nEnter passphrase for \"\/home\/wb2g1app14\/test_ssh\/cle_protegee\" (empty for no passphrase): \nEnter same passphrase again: \nYour identification has been saved in \/home\/wb2g1app14\/test_ssh\/cle_protegee\nYour public key has been saved in \/home\/wb2g1app14\/test_ssh\/cle_protegee.pub\nThe key fingerprint is:\nSHA256:BTw6EeCZgOwWCj6QvT35k0E7MTQt0EQEEYE5gewcgbE caroline@dorian.fr\nThe key's randomart image is:\n+--&#91;ED25519 256]--+\n|=B++B&amp;B+.        |\n|B*=o oB.+.       |\n|E o++o B ..      |\n|.B. + *  .       |\n|. .  o =S        |\n|      +          |\n|       .         |\n|                 |\n|                 |\n+----&#91;SHA256]-----+\nwb2g1app14@ordi:~$ ls test_ssh\/\ncle_protegee  cle_protegee.pub\nwb2g1app14@ordi:~$ <\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">ici j&rsquo;ai mis la passphrase : test123<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wb2g1app14@ordi:~$ ls test_ssh\/ # la cl\u00e9 publique a disparu ! (fais expr\u00e8s) rm test_ssh\/cle_protegee.pub\ncle_protegee\nwb2g1app14@ordi:~$ ssh-keygen -lf ~\/test_ssh\/cle_protegee\n256 SHA256:BTw6EeCZgOwWCj6QvT35k0E7MTQt0EQEEYE5gewcgbE no comment (ED25519)\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>wb2g1app14@ordi:~$ ls test_ssh\/    # la cl\u00e9 publique a disparu ! (fais expr\u00e8s) rm test_ssh\/cle_protegee.pub\ncle_protegee\nwb2g1app14@ordi:~$ ssh-keygen -y -f ~\/test_ssh\/cle_protegee &gt; test_ssh\/cle_protegee.pub\nEnter passphrase for \"\/home\/wb2g1app14\/test_ssh\/cle_protegee\": \nwb2g1app14@ordi:~$ ls test_ssh\/\ncle_protegee  cle_protegee.pub\nwb2g1app14@ordi:~$ \n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Et la pour re-g\u00e9n\u00e9rer la cl\u00e9 publique il faut la passphrase<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">Modifier la passphrase  , option -p <\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>wb2g1app14@ordi:~$ ssh-keygen -p -f test_ssh\/cle_protegee\nEnter old passphrase: \nKey has comment 'caroline@dorian.fr'\nEnter new passphrase (empty for no passphrase): \nEnter same passphrase again: \nYour identification has been saved with the new passphrase.\nwb2g1app14@ordi:~$ \n<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">on peut v\u00e9rifier la passphrase <\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>wb2g1app14@ordi:~$ ssh-keygen -yf test_ssh\/cle_protegee\nEnter passphrase for \"test_ssh\/cle_protegee\": \nssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINpDtfNjAEbJxrVYjRRGbw4R7QZTPb1COzZoHoZyJeXW caroline@dorian.fr\nwb2g1app14@ordi:~$ \n<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">la cl\u00e9 priv\u00e9e ne doit jamais \u00eatre diffus\u00e9e !<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\u26a0\ufe0f <strong>R\u00e8gle d&rsquo;or<\/strong> : la cl\u00e9 <strong>priv\u00e9e<\/strong> (<code>id_ed25519<\/code>, <code>cle_protegee<\/code>) ne sort JAMAIS de la machine, ne se montre JAMAIS, ne se copie JAMAIS sur un serveur. Seule la <code>.pub<\/code> se partage.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">ssh-copy-id<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">permet de copier la cl\u00e9 publique dans le fichier authorized_keys de l&rsquo;h\u00f4te  (ici wb2g1app14)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">actuellement il n y m\u00eame pas ~\/.ssh <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Depuis le client qui veut s&rsquo;identifier avec sa cl\u00e9 publique.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>bruno@debian13:~$ cat ~\/.ssh\/id_ed25519.pub \nssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGTbNRQe9\/l24i2guzpxqNkKknRMSVT\/WYTTsCT+zkK1 ciela2@workboot.fr\nbruno@debian13:~$ \n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>bruno@debian13:~$ ssh-copy-id -p 74 wb2g1app14@workboot.freeboxos.fr\n\/usr\/bin\/ssh-copy-id: INFO: Source of key(s) to be installed: \"\/home\/bruno\/.ssh\/id_ed25519.pub\"\n\/usr\/bin\/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed\n\/usr\/bin\/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys\nwb2g1app14@workboot.freeboxos.fr's password: \n\nNumber of key(s) added: 1\n\nNow try logging into the machine, with: \"ssh -p 74 'wb2g1app14@workboot.freeboxos.fr'\"\nand check to make sure that only the key(s) you wanted were added.\n\nbruno@debian13:~$ \n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">sur l&rsquo;h\u00f4te maintenant :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wb2g1app14@ordi:~\/.ssh$ cat authorized_keys \nssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGTbNRQe9\/l24i2guzpxqNkKknRMSVT\/WYTTsCT+zkK1 ciela2@workboot.fr\nwb2g1app14@ordi:~\/.ssh$<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">on pouvait copier cette cl\u00e9 dans ce fichier , mais la fonction le fait parfaitement.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">maintenant on peut se connecter sans donner le mot de passe  de l&rsquo;utilisateur wb2g1app14 \u00e0 partir de la machine debian13 et en tant que bruno . C&rsquo;est encore plus s\u00e9curis\u00e9 que devoir redonner un mot de passe.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>bruno@debian13:~$ ssh -p 74 wb2g1app14@workboot.freeboxos.fr\nLast login: Tue Oct 20 18:11:41 CEST 2026 from 192.168.1.254 on ssh\n\n    \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557\n    \u2551                                                               \u2551\n    \u2551  \/\/   __        __         _    _                 _           \u2551\n    \u2551 \/\/    \\ \\      \/ \/__  _ __| | _| |__   ___   ___ | |_         \u2551\n    \u2551\/\/      \\ \\ \/\\ \/ \/ _ \\| '__| |\/ \/ '_ \\ \/ _ \\ \/ _ \\| __|        \u2551\n    \u2551\\\\       \\ V  V \/ (_) | |  |   &lt;| |_) | (_) | (_) | |_         \u2551\n    \u2551 \\\\       \\_\/\\_\/ \\___\/|_|  |_|\\_\\_.__\/ \\___\/ \\___\/ \\__|        \u2551\n    \u2551  \\\\                                                           \u2551\n    \u2551                                                               \u2551\n    \u2551              Bienvenue sur le serveur Workboot                \u2551\n    \u2551                                                               \u2551\n    \u2551                 Lyc\u00e9e Caroline Dorian                         \u2551\n    \u2551                                                               \u2551\n    \u255a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255d\n\n    Bonjour et bienvenue sur ton espace de travail !\n\n    Tu disposes ici d'un espace personnel sur Workboot, accessible\n    depuis Windows, Linux ou macOS via SSH.\n\n    Ton espace est limit\u00e9 \u00e0 500 Mo (avertissement) et 600 Mo (blocage).\n    Pense \u00e0 nettoyer r\u00e9guli\u00e8rement tes fichiers volumineux.\n\n    Pour changer ton mot de passe \u00e0 tout moment : tape simplement\n        passwd\n    et suis les instructions.\n\nLast login: Tue Oct 20 09:29:11 2026 from 192.168.1.254\nwb2g1app14@ordi:~$ \n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">ssh<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">ici on utilise ssh avec la cl\u00e9 publique du client est connue de l&rsquo;h\u00f4te (ssh-copy-id)<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">usage classique en terminal<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>bruno@debian13:~$ ssh  -p 74 wb2g1app14@workboot.freeboxos.fr \nLast login: Wed Oct 21 08:57:57 CEST 2026 from 192.168.1.254 on ssh\n\n    \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557\n    \u2551                                                               \u2551\n    \u2551  \/\/   __        __         _    _                 _           \u2551\n    \u2551 \/\/    \\ \\      \/ \/__  _ __| | _| |__   ___   ___ | |_         \u2551\n    \u2551\/\/      \\ \\ \/\\ \/ \/ _ \\| '__| |\/ \/ '_ \\ \/ _ \\ \/ _ \\| __|        \u2551\n    \u2551\\\\       \\ V  V \/ (_) | |  |   &lt;| |_) | (_) | (_) | |_         \u2551\n    \u2551 \\\\       \\_\/\\_\/ \\___\/|_|  |_|\\_\\_.__\/ \\___\/ \\___\/ \\__|        \u2551\n    \u2551  \\\\                                                           \u2551\n    \u2551                                                               \u2551\n    \u2551              Bienvenue sur le serveur Workboot                \u2551\n    \u2551                                                               \u2551\n    \u2551                 Lyc\u00e9e Caroline Dorian                         \u2551\n    \u2551                                                               \u2551\n    \u255a\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255d\n\n    Bonjour et bienvenue sur ton espace de travail !\n\n    Tu disposes ici d'un espace personnel sur Workboot, accessible\n    depuis Windows, Linux ou macOS via SSH.\n\n    Ton espace est limit\u00e9 \u00e0 500 Mo (avertissement) et 600 Mo (blocage).\n    Pense \u00e0 nettoyer r\u00e9guli\u00e8rement tes fichiers volumineux.\n\n    Pour changer ton mot de passe \u00e0 tout moment : tape simplement\n        passwd\n    et suis les instructions.\n\nLast login: Wed Oct 21 08:55:25 2026 from 192.168.1.254\nwb2g1app14@ordi:~$ \n\n<\/code><\/pre>\n\n\n\n<h5 class=\"wp-block-heading\">verbose l&rsquo;option -v (debug)<\/h5>\n\n\n\n<pre class=\"wp-block-code\"><code>bruno@debian13:~$ ssh -v -p 74 wb2g1app14@workboot.freeboxos.fr\ndebug1: OpenSSH_10.0p2 Debian-7+deb13u4, OpenSSL 3.5.7 9 Jun 2026\ndebug1: Reading configuration data \/etc\/ssh\/ssh_config\ndebug1: Reading configuration data \/etc\/ssh\/ssh_config.d\/20-systemd-ssh-proxy.conf\ndebug1: \/etc\/ssh\/ssh_config line 21: Applying options for *\ndebug1: Connecting to workboot.freeboxos.fr &#91;2a01:e34:ec42:770::1] port 74.\ndebug1: connect to address 2a01:e34:ec42:770::1 port 74: Connection refused\ndebug1: Connecting to workboot.freeboxos.fr &#91;78.196.32.119] port 74.\ndebug1: Connection established.\ndebug1: identity file \/home\/bruno\/.ssh\/id_rsa type -1\ndebug1: identity file \/home\/bruno\/.ssh\/id_rsa-cert type -1\ndebug1: identity file \/home\/bruno\/.ssh\/id_ecdsa type -1\ndebug1: identity file \/home\/bruno\/.ssh\/id_ecdsa-cert type -1\ndebug1: identity file \/home\/bruno\/.ssh\/id_ecdsa_sk type -1\ndebug1: identity file \/home\/bruno\/.ssh\/id_ecdsa_sk-cert type -1\ndebug1: identity file \/home\/bruno\/.ssh\/id_ed25519 type 3\ndebug1: identity file \/home\/bruno\/.ssh\/id_ed25519-cert type -1\ndebug1: identity file \/home\/bruno\/.ssh\/id_ed25519_sk type -1\ndebug1: identity file \/home\/bruno\/.ssh\/id_ed25519_sk-cert type -1\ndebug1: identity file \/home\/bruno\/.ssh\/id_xmss type -1\ndebug1: identity file \/home\/bruno\/.ssh\/id_xmss-cert type -1\ndebug1: Local version string SSH-2.0-OpenSSH_10.0p2 Debian-7+deb13u4\ndebug1: Remote protocol version 2.0, remote software version OpenSSH_10.2p1 Ubuntu-2ubuntu3.8\ndebug1: compat_banner: match: OpenSSH_10.2p1 Ubuntu-2ubuntu3.8 pat OpenSSH* compat 0x04000000\ndebug1: Authenticating to workboot.freeboxos.fr:74 as 'wb2g1app14'\ndebug1: load_hostkeys: fopen \/home\/bruno\/.ssh\/known_hosts2: No such file or directory\ndebug1: load_hostkeys: fopen \/etc\/ssh\/ssh_known_hosts: No such file or directory\ndebug1: load_hostkeys: fopen \/etc\/ssh\/ssh_known_hosts2: No such file or directory\ndebug1: SSH2_MSG_KEXINIT sent\ndebug1: SSH2_MSG_KEXINIT received\ndebug1: kex: algorithm: mlkem768x25519-sha256\ndebug1: kex: host key algorithm: ssh-ed25519\ndebug1: kex: server-&gt;client cipher: chacha20-poly1305@openssh.com MAC: &lt;implicit&gt; compression: none\ndebug1: kex: client-&gt;server cipher: chacha20-poly1305@openssh.com MAC: &lt;implicit&gt; compression: none\ndebug1: expecting SSH2_MSG_KEX_ECDH_REPLY\ndebug1: SSH2_MSG_KEX_ECDH_REPLY received\ndebug1: Server host key: ssh-ed25519 SHA256:Lo7+clRof3Ls12T38ftbcuk5LI7CbFRCAKbNsX2Rfno\ndebug1: load_hostkeys: fopen \/home\/bruno\/.ssh\/known_hosts2: No such file or directory\ndebug1: load_hostkeys: fopen \/etc\/ssh\/ssh_known_hosts: No such file or directory\ndebug1: load_hostkeys: fopen \/etc\/ssh\/ssh_known_hosts2: No such file or directory\ndebug1: Host '&#91;workboot.freeboxos.fr]:74' is known and matches the ED25519 host key.\ndebug1: Found key in \/home\/bruno\/.ssh\/known_hosts:55\ndebug1: ssh_packet_send2_wrapped: resetting send seqnr 3\ndebug1: rekey out after 134217728 blocks\ndebug1: SSH2_MSG_NEWKEYS sent\ndebug1: Sending SSH2_MSG_EXT_INFO\ndebug1: expecting SSH2_MSG_NEWKEYS\ndebug1: ssh_packet_read_poll2: resetting read seqnr 3\ndebug1: SSH2_MSG_NEWKEYS received\ndebug1: rekey in after 134217728 blocks\ndebug1: SSH2_MSG_EXT_INFO received\ndebug1: kex_ext_info_client_parse: server-sig-algs=&lt;ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,rsa-sha2-512,rsa-sha2-256&gt;\ndebug1: kex_ext_info_check_ver: publickey-hostbound@openssh.com=&lt;0&gt;\ndebug1: kex_ext_info_check_ver: ping@openssh.com=&lt;0&gt;\ndebug1: SSH2_MSG_SERVICE_ACCEPT received\ndebug1: SSH2_MSG_EXT_INFO received\ndebug1: kex_ext_info_client_parse: server-sig-algs=&lt;ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,rsa-sha2-512,rsa-sha2-256&gt;\ndebug1: Authentications that can continue: publickey,password\ndebug1: Next authentication method: publickey\ndebug1: get_agent_identities: bound agent to hostkey\ndebug1: get_agent_identities: ssh_fetch_identitylist: agent contains no identities\ndebug1: Will attempt key: \/home\/bruno\/.ssh\/id_rsa \ndebug1: Will attempt key: \/home\/bruno\/.ssh\/id_ecdsa \ndebug1: Will attempt key: \/home\/bruno\/.ssh\/id_ecdsa_sk \ndebug1: Will attempt key: \/home\/bruno\/.ssh\/id_ed25519 ED25519 SHA256:GQT4Km5nqRYaviCcQJyxtbvNu+J0+m4c1sGYDZQrow8\ndebug1: Will attempt key: \/home\/bruno\/.ssh\/id_ed25519_sk \ndebug1: Will attempt key: \/home\/bruno\/.ssh\/id_xmss \ndebug1: Trying private key: \/home\/bruno\/.ssh\/id_rsa\ndebug1: Trying private key: \/home\/bruno\/.ssh\/id_ecdsa\ndebug1: Trying private key: \/home\/bruno\/.ssh\/id_ecdsa_sk\ndebug1: Offering public key: \/home\/bruno\/.ssh\/id_ed25519 ED25519 SHA256:GQT4Km5nqRYaviCcQJyxtbvNu+J0+m4c1sGYDZQrow8\ndebug1: Server accepts key: \/home\/bruno\/.ssh\/id_ed25519 ED25519 SHA256:GQT4Km5nqRYaviCcQJyxtbvNu+J0+m4c1sGYDZQrow8\nAuthenticated to workboot.freeboxos.fr (&#91;78.196.32.119]:74) using \"publickey\".\ndebug1: channel 0: new session &#91;client-session] (inactive timeout: 0)\ndebug1: Requesting no-more-sessions@openssh.com\ndebug1: Entering interactive session.\ndebug1: pledge: filesystem\ndebug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0\ndebug1: client_input_hostkeys: searching \/home\/bruno\/.ssh\/known_hosts for &#91;workboot.freeboxos.fr]:74 \/ (none)\ndebug1: client_input_hostkeys: searching \/home\/bruno\/.ssh\/known_hosts2 for &#91;workboot.freeboxos.fr]:74 \/ (none)\ndebug1: client_input_hostkeys: hostkeys file \/home\/bruno\/.ssh\/known_hosts2 does not exist\ndebug1: client_input_hostkeys: host key found matching a different name\/address, skipping UserKnownHostsFile update\ndebug1: Remote: \/home\/wb2g1app14\/.ssh\/authorized_keys:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding\ndebug1: Remote: \/home\/wb2g1app14\/.ssh\/authorized_keys:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding\ndebug1: Sending environment.\ndebug1: channel 0: setting env COLORTERM = \"truecolor\"\ndebug1: channel 0: setting env LANG = \"fr_FR.UTF-8\"\ndebug1: pledge: fork\nLast login: Tue Oct 20 18:19:53 CEST 2026 from 192.168.1.254 on ssh\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">on peut voir qu&rsquo;il se passe pas mal de choses !!<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">avec ssh on peut juste faire une commande <\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">on peut ex\u00e9cuter une commande \u00e0 distance avec ssh , un exemple est plus clair <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>bruno@debian13:~$ ssh  -p 74 wb2g1app14@workboot.freeboxos.fr 'ls -la'\ntotal 32\ndrwx------  4 wb2g1app14 wb2g1app14 4096 Oct 21 08:56 .\ndrwxr-xr-x 90 root       root       4096 Oct  8 09:37 ..\n-rw-------  1 wb2g1app14 wb2g1app14  379 Oct 21 08:56 .bash_history\n-rw-r--r--  1 wb2g1app14 wb2g1app14  392 Oct  4 19:22 .bash_logout\n-rw-r--r--  1 wb2g1app14 wb2g1app14 4049 Oct  4 19:26 .bashrc\ndrwx------  2 wb2g1app14 wb2g1app14 4096 Oct 21 08:56 .cache\n-rw-------  1 wb2g1app14 wb2g1app14   20 Oct 19 18:13 .lesshst\ndrwx------  2 wb2g1app14 wb2g1app14 4096 Oct 20 18:11 .ssh\nbruno@debian13:~$ \n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">un  autre exemple :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>bruno@debian13:~$ echo $USER\nbruno\nbruno@debian13:~$ ssh  -p 74 wb2g1app14@workboot.freeboxos.fr 'echo $USER'\nwb2g1app14\nbruno@debian13:~$ <\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">ssh-agent<\/h2>\n\n\n\n<h2 class=\"wp-block-heading\">ssh-add<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Pr\u00e9sentation: Analogie simple : Points cl\u00e9s \u00e0 expliquer : Les fichiers id_ed25519 : cl\u00e9 priv\u00e9e (ne jamais d\u00e9voiler) id_ed25519.pub : cl\u00e9 publique (\u00e0 partager) known_hosts : Cl\u00e9s publiques des serveurs d\u00e9j\u00e0 visit\u00e9s par cette machine (= les \u00ab visit\u00e9s \u00bb), h\u00f4tes connus authorized_keys : Cl\u00e9s publiques d&rsquo;utilisateurs autoris\u00e9s \u00e0 se connecter sur la machine locale. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_uag_custom_page_level_css":"","footnotes":""},"class_list":["post-9250","page","type-page","status-publish","hentry"],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"admin","author_link":"https:\/\/workboot.fr\/ciela\/author\/admin\/"},"uagb_comment_info":0,"uagb_excerpt":"Pr\u00e9sentation: Analogie simple : Points cl\u00e9s \u00e0 expliquer : Les fichiers id_ed25519 : cl\u00e9 priv\u00e9e (ne jamais d\u00e9voiler) id_ed25519.pub : cl\u00e9 publique (\u00e0 partager) known_hosts : Cl\u00e9s publiques des serveurs d\u00e9j\u00e0 visit\u00e9s par cette machine (= les \u00ab visit\u00e9s \u00bb), h\u00f4tes connus authorized_keys : Cl\u00e9s publiques d&rsquo;utilisateurs autoris\u00e9s \u00e0 se connecter sur la machine locale.\u2026","_links":{"self":[{"href":"https:\/\/workboot.fr\/ciela\/wp-json\/wp\/v2\/pages\/9250","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/workboot.fr\/ciela\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/workboot.fr\/ciela\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/workboot.fr\/ciela\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/workboot.fr\/ciela\/wp-json\/wp\/v2\/comments?post=9250"}],"version-history":[{"count":41,"href":"https:\/\/workboot.fr\/ciela\/wp-json\/wp\/v2\/pages\/9250\/revisions"}],"predecessor-version":[{"id":9268,"href":"https:\/\/workboot.fr\/ciela\/wp-json\/wp\/v2\/pages\/9250\/revisions\/9268"}],"wp:attachment":[{"href":"https:\/\/workboot.fr\/ciela\/wp-json\/wp\/v2\/media?parent=9250"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}