AOS 6 - SSH Key installieren: Unterschied zwischen den Versionen
Aus QBWiki
Zur Navigation springenZur Suche springen
Pascal (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „__NOTOC__ ===SSH Key erstellen (Lokale Maschine)=== <syntaxhighlight lang="bash"> # SSH Key unbedingt mit einem sehr sicherem Passwort anlegen. # Sonst kann…“) |
Pascal (Diskussion | Beiträge) |
||
| (3 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
| Zeile 1: | Zeile 1: | ||
__NOTOC__ | __NOTOC__ | ||
| + | |||
| + | '''SSH Options (~/.ssh/config)''' | ||
| + | <syntaxhighlight lang="bash"> | ||
| + | Host 172.30.100.* | ||
| + | User user | ||
| + | HostKeyAlgorithms ssh-dss | ||
| + | MACs hmac-sha1 | ||
| + | KexAlgorithms diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1 | ||
| + | PubkeyAcceptedKeyTypes +ssh-dss | ||
| + | Ciphers aes256-cbc | ||
| + | </syntaxhighlight> | ||
| + | |||
| Zeile 42: | Zeile 54: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
| − | ssh -i ~/.ssh/ | + | ssh -i ~/.ssh/id_dsa <user>@<device> |
| − | # ssh -i ~/.ssh/ | + | # ssh -i ~/.ssh/id_dsa sup@172.30.100.2 |
</syntaxhighlight> | </syntaxhighlight> | ||
| Zeile 50: | Zeile 62: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
| − | + | rm /flash/network/pub/<dsa_key_file> | |
| − | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Aktuelle Version vom 20. März 2019, 15:43 Uhr
SSH Options (~/.ssh/config)
Host 172.30.100.*
User user
HostKeyAlgorithms ssh-dss
MACs hmac-sha1
KexAlgorithms diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
PubkeyAcceptedKeyTypes +ssh-dss
Ciphers aes256-cbc
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 dsa -b 1024 -qf id_dsa
# Enter passphrase (empty for no passphrase): For!Example_a_Password_22LikeThis;
# <--- Mindestens 9 Zeichen + Groß-, Kleinbuchstaben, Sonderzeichen und Ziffern ---->
Switch vorbereiten und SSH Key installieren
aaa authentication ssh local
# aaa authentication default local (schaltet ftp, http, snmp, telnet ein)
mkdir /flash/network/pub
vi /flash/network/pub/<switch_user>_dsa.pub
# Es ist wichtig, dass der switch_user auf dem OmniSwitch existiert! Die
# Datei muss dem dem Namen + "_dsa.pub" tragen.
# --- Key entweder über sftp kopieren oder copy+paste
vi /flash/network/pub/admin_dsa.pub
# Oder wie folgt:
# sftp xxx.xxx.xxx.xxx ; cd /flash/network/pub/ ; put <file>
Login
ssh -i ~/.ssh/id_dsa <user>@<device>
# ssh -i ~/.ssh/id_dsa sup@172.30.100.2
SSH Key entfernen
rm /flash/network/pub/<dsa_key_file>