AOS 6 - SSH Key installieren: Unterschied zwischen den Versionen
Aus QBWiki
Zur Navigation springenZur Suche springen
Pascal (Diskussion | Beiträge) |
Pascal (Diskussion | Beiträge) |
||
| Zeile 1: | Zeile 1: | ||
__NOTOC__ | __NOTOC__ | ||
==== SSH Options (~/.ssh/config) ==== | ==== SSH Options (~/.ssh/config) ==== | ||
| − | + | <syntaxhighlight lang="bash"> | |
Host 172.30.100.* | Host 172.30.100.* | ||
User user | User user | ||
| Zeile 9: | Zeile 9: | ||
PubkeyAcceptedKeyTypes +ssh-dss | PubkeyAcceptedKeyTypes +ssh-dss | ||
Ciphers aes256-cbc | Ciphers aes256-cbc | ||
| − | + | </syntaxhighlight> | |
===SSH Key erstellen (Lokale Maschine)=== | ===SSH Key erstellen (Lokale Maschine)=== | ||
Version vom 20. März 2019, 15:42 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>