Published

Tue 28 July 2020

←Home

Connexion par clé SSH en utilisant l'ED25519 comme algo

Génération de la clé publique et de la clé privée, en utilisant l’algo ed25519, avec une clé de 163684 bits

ssh-keygen -t ed25519 -b 163684

La génération des clés se fait:

Generating public/private ed25519 key pair.
Enter file in which to save the key (/Users/pc/.ssh/id_ed25519):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/pc/.ssh/id_ed25519.
Your public key has been saved in /Users/pc/.ssh/id_ed25519.pub.
The key fingerprint is:
SHA256: trucbidule pc@monpc.local
The key's randomart image is:
+--[ED25519 256]—+
+----[SHA256]-----+

On a ces deux clés, il faut désormais transférer la clé publique:

ssh-copy-id -i .ssh/id_ed25519.pub user@monip -p 6666

Ce qui est affiché lors du transfert de la clé publique:

/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: ".ssh/id_ed25519.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/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
user@monip's password:

Number of key(s) added:        1

Now try logging into the machine, with:   "ssh -p '6666' ‘user@monip'" and check to make sure that only the key(s) you wanted were added.

On peut désormais se connecter avec une passphrase:

ssh -p '6666'user@monip'
Enter passphrase for key '/Users/pc/.ssh/id_ed25519':

Connexion faite!

user@servssh:~$
Go Top