AOS 8 - SSH Key installieren: Unterschied zwischen den Versionen
Aus QBWiki
Zur Navigation springenZur Suche springen
Pascal (Diskussion | Beiträge) |
Pascal (Diskussion | Beiträge) |
||
| (4 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
| Zeile 4: | Zeile 4: | ||
===SSH Key erstellen (Lokale Maschine)=== | ===SSH Key erstellen (Lokale Maschine)=== | ||
| − | <syntaxhighlight lang="bash | + | <syntaxhighlight lang="bash"> |
# SSH Key unbedingt mit einem sehr sicherem Passwort anlegen. | # SSH Key unbedingt mit einem sehr sicherem Passwort anlegen. | ||
# Sonst kann ein potenzieller kompromittierter Key keinen | # Sonst kann ein potenzieller kompromittierter Key keinen | ||
| Zeile 12: | Zeile 12: | ||
# Optional für jeden Switch einen eigenen Key. Oder pro "Gruppe?". Mit -C ein Kommentar angeben, z.B. | # Optional für jeden Switch einen eigenen Key. Oder pro "Gruppe?". Mit -C ein Kommentar angeben, z.B. | ||
# -C remote_ssh_user@device. Den Keynamen entsprechend anpassen. (Empfehlung in der Alcatel Dokumentation) | # -C remote_ssh_user@device. Den Keynamen entsprechend anpassen. (Empfehlung in der Alcatel Dokumentation) | ||
| − | ssh-keygen -t rsa -b | + | ssh-keygen -t rsa -b 4096 -qf id_rsa |
# Enter passphrase (empty for no passphrase): For!Example_a_Password_22LikeThis; | # Enter passphrase (empty for no passphrase): For!Example_a_Password_22LikeThis; | ||
# <--- Mindestens 9 Zeichen + Groß-, Kleinbuchstaben, Sonderzeichen und Ziffern ----> | # <--- Mindestens 9 Zeichen + Groß-, Kleinbuchstaben, Sonderzeichen und Ziffern ----> | ||
| − | scp ~/.ssh/id_rsa.pub <user>@<device>:/flash/system/ | + | scp ~/.ssh/id_rsa.pub <user>@<device>:/flash/system/remote_user_key_rsa.pub |
| + | # scp ~/.ssh/id_rsa.pub sup@172.30.100.17:/flash/system/padi_10.0.2.93_rsa.pub | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| − | Switch vorbereiten | + | ===Switch vorbereiten und SSH Key installieren=== |
| + | <syntaxhighlight lang="bash"> | ||
| − | + | aaa authentication ssh local | |
| + | # aaa authentication default local (schaltet ftp, http, snmp, telnet ein) | ||
| + | |||
| + | installsshkey <user> /flash/system/remote_user_key_rsa.pub | ||
| + | # installsshkey sup /flash/system/padi_10.0.2.93_rsa.pub | ||
| + | # Installed new SSH Key. | ||
| + | </syntaxhighlight> | ||
===Login=== | ===Login=== | ||
| + | |||
| + | <syntaxhighlight lang="bash"> | ||
| + | ssh -i ~/.ssh/id_rsa <user>@<device> | ||
| + | # ssh -i ~/.ssh/id_rsa sup@172.30.100.17 | ||
| + | </syntaxhighlight> | ||
| + | |||
| + | |||
| + | ===SSH Key entfernen=== | ||
| + | |||
| + | <syntaxhighlight lang="bash"> | ||
| + | removesshkey <user> <remote_user>@<remote_ip> | ||
| + | # removesshkey sup padi@172.30.100.17 | ||
| + | </syntaxhighlight> | ||
Aktuelle Version vom 6. März 2019, 10:35 Uhr
SSH Key erstellen (Lokale Maschine)
# SSH Key unbedingt mit einem sehr sicherem Passwort anlegen.
# Sonst kann ein potenzieller kompromittierter Key keinen
# weiteren Schaden anrichten.
cd ~/.ssh
# Optional für jeden Switch einen eigenen Key. Oder pro "Gruppe?". Mit -C ein Kommentar angeben, z.B.
# -C remote_ssh_user@device. Den Keynamen entsprechend anpassen. (Empfehlung in der Alcatel Dokumentation)
ssh-keygen -t rsa -b 4096 -qf id_rsa
# Enter passphrase (empty for no passphrase): For!Example_a_Password_22LikeThis;
# <--- Mindestens 9 Zeichen + Groß-, Kleinbuchstaben, Sonderzeichen und Ziffern ---->
scp ~/.ssh/id_rsa.pub <user>@<device>:/flash/system/remote_user_key_rsa.pub
# scp ~/.ssh/id_rsa.pub sup@172.30.100.17:/flash/system/padi_10.0.2.93_rsa.pub
Switch vorbereiten und SSH Key installieren
aaa authentication ssh local
# aaa authentication default local (schaltet ftp, http, snmp, telnet ein)
installsshkey <user> /flash/system/remote_user_key_rsa.pub
# installsshkey sup /flash/system/padi_10.0.2.93_rsa.pub
# Installed new SSH Key.
Login
ssh -i ~/.ssh/id_rsa <user>@<device>
# ssh -i ~/.ssh/id_rsa sup@172.30.100.17
SSH Key entfernen
removesshkey <user> <remote_user>@<remote_ip>
# removesshkey sup padi@172.30.100.17