Authentifizierung mit Schlüssel: Unterschied zwischen den Versionen

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen
Zeile 29: Zeile 29:
 
  Enter passphrase for /home/thomas.will/.ssh/id_rsa:  
 
  Enter passphrase for /home/thomas.will/.ssh/id_rsa:  
 
  Identity added: /home/thomas.will/.ssh/id_rsa (thomas.will@krill.xinux.de)
 
  Identity added: /home/thomas.will/.ssh/id_rsa (thomas.will@krill.xinux.de)
 +
=Anzeigen der verwendeten Schlüssel=
 +
*ssh-add -l
 +
3072 SHA256:NGHDaxxybASHbsC+Ukd1vW6f1itSKgs/IZvI8Ufyl+g thomas.will@krill.xinux.de (RSA)

Version vom 21. Oktober 2021, 09:19 Uhr

Schlüsselpaar erstellen

Man sollte hier ein Passwort eingeben. Nur so ist sichergestellt, das bei einem Verlust des Schlüssels ein Angreifer sich nicht einlogen kann.
  • ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/xinux/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/xinux/.ssh/id_rsa.
Your public key has been saved in /home/xinux/.ssh/id_rsa.pub.
The key fingerprint is:
a7:13:ec:54:a3:4f:29:32:f8:98:04:ea:0c:b9:62:04 xinux@zero
The key's randomart image is:
+--[ RSA 2048]----+
|                 |
|                 |
|E .       o      |
|.o . . . o o     |
|+.  o o S +      |
|=. . + = B       |
|o+  o . + .      |
|o        .       |
|                 |
+-----------------+
xinux@zero:~$

SSH private Key im Nachhinein mit Passwort sichern

  • ssh-keygen -p -f ~/.ssh/id_rsa

Key zum Agent hinzufügen

  • ssh-add
Enter passphrase for /home/thomas.will/.ssh/id_rsa: 
Identity added: /home/thomas.will/.ssh/id_rsa (thomas.will@krill.xinux.de)

Anzeigen der verwendeten Schlüssel

  • ssh-add -l
3072 SHA256:NGHDaxxybASHbsC+Ukd1vW6f1itSKgs/IZvI8Ufyl+g thomas.will@krill.xinux.de (RSA)