تسعى مجموعة الوثائق لهذا المنتج جاهدة لاستخدام لغة خالية من التحيز. لأغراض مجموعة الوثائق هذه، يتم تعريف "خالية من التحيز" على أنها لغة لا تعني التمييز على أساس العمر، والإعاقة، والجنس، والهوية العرقية، والهوية الإثنية، والتوجه الجنسي، والحالة الاجتماعية والاقتصادية، والتمييز متعدد الجوانب. قد تكون الاستثناءات موجودة في الوثائق بسبب اللغة التي يتم تشفيرها بشكل ثابت في واجهات المستخدم الخاصة ببرنامج المنتج، أو اللغة المستخدمة بناءً على وثائق RFP، أو اللغة التي يستخدمها منتج الجهة الخارجية المُشار إليه. تعرّف على المزيد حول كيفية استخدام Cisco للغة الشاملة.
ترجمت Cisco هذا المستند باستخدام مجموعة من التقنيات الآلية والبشرية لتقديم محتوى دعم للمستخدمين في جميع أنحاء العالم بلغتهم الخاصة. يُرجى ملاحظة أن أفضل ترجمة آلية لن تكون دقيقة كما هو الحال مع الترجمة الاحترافية التي يقدمها مترجم محترف. تخلي Cisco Systems مسئوليتها عن دقة هذه الترجمات وتُوصي بالرجوع دائمًا إلى المستند الإنجليزي الأصلي (الرابط متوفر).
يصف هذا وثيقة الخطوات أن يضيف (أو) يزيل تشفير، MACs، وخوارزميات KEX في Nexus منصة.
توصي Cisco بأن تفهم أساسيات Linux و Bash.
تستند المعلومات الواردة في هذا المستند إلى إصدارات المكونات المادية والبرامج التالية:
تم إنشاء المعلومات الواردة في هذا المستند من الأجهزة الموجودة في بيئة معملية خاصة. بدأت جميع الأجهزة المُستخدمة في هذا المستند بتكوين ممسوح (افتراضي). إذا كانت شبكتك قيد التشغيل، فتأكد من فهمك للتأثير المحتمل لأي أمر.
في بعض الأحيان، يمكن أن تجد عمليات المسح الأمني طرق تشفير ضعيفة تستخدم من قبل أجهزة Nexus. إذا حدث هذا، فإن التغييرات علىdcos_sshd_config
الملف على المحولات مطلوبة لإزالة هذه الخوارزميات غير الآمنة.
لتأكيد خوارزميات التشفير، MAC، و KEX التي يستخدمها النظام الأساسي وتحقق من ذلك من جهاز خارجي يمكنك إستخدام هذه الخيارات:
فتح خط CMD على جهاز كمبيوتر شخصي يمكنه الوصول إلى جهاز Nexus واستخدام الأمر ssh -vvv
.
C:\Users\xxxxx>ssh -vvv
--------- snipped ------------
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,curve25519-sha256@libssh.org <--- Kex algorithms
debug2: host key algorithms: ssh-rsa
debug2: ciphers ctos: aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,aes192-cbc,aes256-cbc
debug2: ciphers stoc: aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,aes192-cbc,aes256-cbc <--- encryption algorithms
debug2: MACs ctos: hmac-sha1
debug2: MACs stoc: hmac-sha1 <--- mac algorithms
debug2: compression ctos: none,zlib@openssh.com
debug2: compression stoc: none,zlib@openssh.com <--- compression algorithms
ينطبق هذا على:
الخطوات:
switch(config)# feature bash-shell
switch(config)#
switch(config)# run bash
bash-4.3$
2. مراجعة المحتويات منdcos_sshd_config
الملف:
bash-4.3$ cat /isan/etc/dcos_sshd_config
ملاحظة: يمكنك إستخدام egrep للنظر في أسطر معينة: cat /isan/etc/dcos_sshd_config | grep MAC
ينطبق هذا على:
الخطوات:
1. افتح حالة مركز المساعدة الفنية للحصول على ملف التوصيل الذي يطابق إصدار NXOS الذي يعمل على المحول.
2. قم بتحميل ملف التوصيل التوصيل إلى ذاكرة التمهيد المؤقتة (bootflash) وإنشاء نسخة منه.
switch# copy bootflash:nuova-or-dplug-mzg.7.3.8.N1.1 bootflash:dp
ملاحظة: يتم إنشاء نسخة ("dp") من ملف DPLUG الأصلي في bootflash، بحيث يتم إزالة النسخة فقط بعد تحميل dplug ويبقى ملف dplug الأصلي في bootflash للتشغيل اللاحق.
3. قم بتحميل نسخة الأمر من خلالload
الأمر.
n5k-1# load bootflash:dp
Loading plugin version 7.3(8)N1(1)
###############################################################
Warning: debug-plugin is for engineering internal use only!
For security reason, plugin image has been deleted.
###############################################################
Successfully loaded debug-plugin!!!
Linux(debug)#
Linux(debug)#
2. مراجعةdcos_sshd_config
الملف.
Linux(debug)# cat /isan/etc/dcos_sshd_config
1. إرسال نسخة منdcos_sshd_config
الملف إلى bootflash:
Linux(debug)# cd /isan/etc/
Linux(debug)# copy dcos_sshd_config /bootflash/dcos_sshd_config
Linux(debug)# exit
2. تأكد من أن النسخة موجودة على bootflash:
switch(config)# dir bootflash: | i ssh
7372 Mar 24 02:24:13 2023 dcos_sshd_config
3. التصدير إلى خادم:
switch# copy bootflash: ftp:
Enter source filename: dcos_sshd_config
Enter vrf (If no input, current vrf 'default' is considered): management
Enter hostname for the ftp server: <hostname>
Enter username: <username>
Password:
***** Transfer of file Completed Successfully *****
Copy complete, now saving to disk (please wait)...
Copy complete.
4. قم بإجراء التغييرات اللازمة على الملف ثم قم باستيراده إلى bootflash.
1. قم بتحميل الملف المعدلdcos_sshd_config
إلى ذاكرة Flash (الذاكرة المؤقتة) للتمهيد.
switch# copy ftp: bootflash:
Enter source filename: dcos_sshd_config_modified.txt
Enter vrf (If no input, current vrf 'default' is considered): management
Enter hostname for the ftp server: <hostname>
Enter username: <username>
Password:
***** Transfer of file Completed Successfully *****
Copy complete, now saving to disk (please wait)...
Copy complete.
switch#
من خلال إستبدال الملف الموجودdcos_sshd_config
ضمن/isan/etc/
ملفdcos_sshd_config
معدل موجود في bootflash. هذه العملية غير مستمرة عبر عمليات إعادة التمهيد
ssh config
إلى bootflash:switch# dir bootflash: | i ssh
7372 Mar 24 02:24:13 2023 dcos_sshd_config_modified
2. أثناء العمل في الوضع base أو linux(debug)#، قم باستبدال الملف الموجودdcos_sshd_config
بالملف الموجود في bootflash:
bash-4.3$ sudo su
bash-4.3# copy /bootflash/dcos_sshd_config_modified /isan/etc/dcos_sshd_config
3. تأكد من نجاح التغييرات:
bash-4.3$ cat /isan/etc/dcos_sshd_config
باستخدام برنامج IM النصي الذي يتم تشغيله عند ظهور السجل "VDC_MGR-2-VDC_ONLINE" بعد إعادة التحميل. في حالة تشغيل IM، يتم تشغيل برنامج نصي لمحرك الأقراص ويستبدل الملف الموجودdcos_sshd_config
أدناه/isan/etc/
dcos_sshd_config
بملف معدل موجود في bootflash. لا ينطبق هذا إلا على إصدارات NX-OS التي تدعم "سمة baseShell".
switch# dir bootflash: | i ssh
7404 Mar 03 16:10:43 2023 dcos_sshd_config_modified_7k
switch#
2. قم بإنشاء نص تنفيذي يطبق التغييرات علىdcos_sshd_config
الملف. تأكد من حفظ الملف بامتداد "py".
#!/usr/bin/env python
import os
os.system("sudo usermod -s /bin/bash root")
os.system("sudo su -c \"cp /bootflash/dcos_sshd_config_modified_7k /isan/etc/dcos_sshd_config\"")
3. تحميل البرنامج النصي Python إلى bootflash.
switch# dir bootflash:///scripts
175 Mar 03 16:11:01 2023 ssh_workaround_7k.py
ملاحظة: تكون نصوص Python النصية متماثلة إلى حد كبير على جميع الأنظمة الأساسية، باستثناء N7K الذي يحتوي على بعض الخطوط الإضافية للتغلب على معرف تصحيح الأخطاء من Cisco CSCva14865.
4. تأكد من أنdcos_sshd_config
اسم الملف من النص التنفيذي و bootflash (الخطوة 1.) هي نفسها:
switch# dir bootflash: | i ssh
7404 Mar 03 16:10:43 2023 dcos_sshd_config_modified_7k
switch#
switch# show file bootflash:///scripts/ssh_workaround_7k.py
#!/usr/bin/env python
import os
os.system("sudo usermod -s /bin/bash root")
os.system("sudo su -c \"cp /bootflash/dcos_sshd_config_modified_7k /isan/etc/dcos_sshd_config\"")
switch#
4. قم بتشغيل البرنامج النصي مرة واحدة، بحيثdcos_sshd_config
يتم تغيير الملف.
switch# source ssh_workaround_7k.py
switch#
5. قم بتكوين برنامج نصي IM، حتى يتم تشغيل البرنامج النصي PY في كل مرة يتم فيها إعادة تشغيل المحول ثم يعود مرة أخرى.
EEM N7K:
event manager applet SSH_workaround
event syslog pattern "vdc 1 has come online"
action 1.0 cli command "source ssh_workaround_7k.py"
action 2 syslog priority alerts msg "SSH Workaround implemented"
ملاحظة: يمكن أن تختلف صياغة EEM على إصدارات NXOS المختلفة (تتطلب بعض الإصدارات "action <id> cli" والبعض الآخر "action <id> cli command")، لذلك تأكد من أخذ أوامر IM بشكل صحيح.
switch# dir | i i ssh
7732 Jun 18 16:49:47 2024 dcos_sshd_config
7714 Jun 18 16:54:20 2024 dcos_sshd_config_modified
switch#
2. قم بإنشاء نص تنفيذي يطبق التغييرات علىdcos_sshd_config
الملف. تأكد من حفظ الملف باستخدام الملحق "py".
#!/usr/bin/env python
import os
os.system("sudo su -c \"cp /bootflash/dcos_sshd_config_modified /isan/etc/dcos_sshd_config\"")
3. تحميل البرنامج النصي python إلى bootflash.
switch# dir | i i .py
127 Jun 18 17:21:39 2024 ssh_workaround_9k.py
switch#
4. تأكد من أنdcos_sshd_config
اسم الملف من البرنامج النصي ومن bootflash (الخطوة 1.) هما نفسهما:
switch# dir | i i ssh
7732 Jun 18 16:49:47 2024 dcos_sshd_config
7714 Jun 18 16:54:20 2024 dcos_sshd_config_modified
127 Jun 18 17:21:39 2024 ssh_workaround_9k.py
switch#
switch# sh file bootflash:ssh_workaround_9k.py
#!/usr/bin/env python
import os
os.system("sudo su -c \"cp /bootflash/dcos_sshd_config_modified /isan/etc/dcos_sshd_config\"")
switch#
4. قم بتشغيل البرنامج النصي مرة واحدة، بحيثdcos_sshd_config
يتم تغيير الملف.
switch# python bootflash:ssh_workaround_9k.py
5. قم بتكوين برنامج نصي IM، حتى يتم تشغيل البرنامج النصي PY في كل مرة يتم فيها إعادة تشغيل المحول ثم يعود مرة أخرى.
EEM N9K و N3K:
event manager applet SSH_workaround
event syslog pattern "vdc 1 has come online"
action 1.0 cli python bootflash:ssh_workaround_9k.py
action 2 syslog priority alerts msg SSH Workaround implemented
ملاحظة: يمكن أن تختلف صياغة EEM على إصدارات NXOS المختلفة (تتطلب بعض الإصدارات "action <id> cli" والبعض الآخر "action <id> cli command")، لذلك تأكد من أخذ أوامر IM بشكل صحيح.
تم إنشاء ملف DPLUG معدل عبر معرف تصحيح الأخطاء من Cisco CSCvr23488 لإزالة خوارزميات KEX هذه:
إن ملفات dpug الموفرة عبر cisco بق id CSCvr23488 ليست نفسها التي يتم إستخدامها للوصول إلى طبقة Linux. افتح حالة مركز المساعدة الفنية للحصول على المكون الإضافي المعدل من معرف تصحيح الأخطاء من Cisco CSCvr23488.
dcos_sshd_config
عملية إعداد:C:\Users\user>ssh -vvv admin@
---- snipped ----
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1, diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 <--- kex algorithms
debug2: host key algorithms: ssh-rsa
debug2: ciphers ctos: aes128-ctr,aes192-ctr,aes256-ctr
debug2: ciphers stoc: aes128-ctr,aes192-ctr,aes256-ctr <--- encryption algorithms
debug2: MACs ctos: hmac-sha1
debug2: MACs stoc: hmac-sha1 <--- mac algorithms
debug2: compression ctos: none,zlib@openssh.com
debug2: compression stoc: none,zlib@openssh.com <--- compression algorithms
2. قم بإنشاء نسخة من ملف DPLUG المعدل.
switch# copy bootflash:nuova-or-dplug-mzg.7.3.14.N1.1_CSCvr23488.bin bootflash:dp
ملاحظة: يتم إنشاء نسخة ("dp") من ملف DPLUG الأصلي في bootflash بحيث تتم إزالة النسخة فقط بعد تحميل التوصيل ويبقى ملف dplug الأصلي في bootflash للتشغيل اللاحق.
3. تطبيق ملف التوصيل من معرف تصحيح الأخطاء من Cisco CSCvr23488 يدويا:
switch# load bootflash:dp2
Loading plugin version 7.3(14)N1(1)
###############################################################
Warning: debug-plugin is for engineering internal use only!
For security reason, plugin image has been deleted.
###############################################################
Successfully loaded debug-plugin!!!
Workaround for CSCvr23488 implemented
switch#
4. تحقق من الإعدادات الجديدةdcos_sshd_config
:
C:\Users\user>ssh -vvv admin@<hostname>
---- snipped ----
debug2: peer server KEXINIT proposal
debug2: KEX algorithms: diffie-hellman-group14-sha1,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521
debug2: host key algorithms: ssh-rsa
debug2: ciphers ctos: aes128-ctr,aes192-ctr,aes256-ctr
debug2: ciphers stoc: aes128-ctr,aes192-ctr,aes256-ctr
debug2: MACs ctos: hmac-sha1
debug2: MACs stoc: hmac-sha1
debug2: compression ctos: none,zlib@openssh.com
debug2: compression stoc: none,zlib@openssh.com
5. أجعل هذا التغيير مستمرا عبر عمليات إعادة التشغيل باستخدام برنامج IM:
event manager applet CSCvr23488_workaround
event syslog pattern "VDC_MGR-2-VDC_ONLINE"
action 1 cli command "copy bootflash:nuova-or-dplug-mzg.7.3.14.N1.1_CSCvr23488.bin bootflash:dp"
action 2 cli command "load bootflash:dp"
action 3 cli command "conf t ; no feature ssh ;feature ssh"
action 4 syslog priority alerts msg "CSCvr23488 Workaround implemented"
ملاحظة:
F241.06.24-N7706-1(config)# feature bash-shell
F241.06.24-N7706-1(config)# run bash
bash-4.3$ sudo su
Cannot execute /isanboot/bin/nobash: No such file or directory <---
bash-4.3$
للتغلب على هذا، اكتب ما يلي:
bash-4.3$ sudo usermod -s /bin/bash root
بعد هذه ال"سودو سو" تعمل:
bash-4.3$ sudo su
bash-4.3#
ملاحظة: لا ينجو هذا التغيير من إعادة تحميل.
dcos_sshd_config
لكل VDC، في حالة الحاجة إلى تعديل معلمات SSH على VDC مختلف، تأكد من تعديل الملفdcos_sshd_config
المطابق.N7K# run bash
bash-4.3$ cd /isan/etc/
bash-4.3$ ls -la | grep ssh
-rw-rw-r-- 1 root root 7564 Mar 27 13:48 dcos_sshd_config <--- VDC 1
-rw-rw-r-- 1 root root 7555 Mar 27 13:48 dcos_sshd_config.2 <--- VDC 2
-rw-rw-r-- 1 root root 7555 Mar 27 13:48 dcos_sshd_config.3 <--- VDC 3
dcos_sshd_config
الملف بشكل دائم عبر عمليات إعادة التمهيد على أي نظام Nexus أساسي. إذا كانت التغييرات بحاجة إلى أن تكون مستمرة، فيمكن إستخدام IM لتعديل الملف في كل مرة يتم فيها تمهيد المحول. مثال CLI من مفتاح يركض 10.5(1):
switch(config)# ssh ?
cipher-mode Set Cipher-mode for ssh
ciphers Ciphers to encrypt the connection <<<<<<<<<
idle-timeout SSH Client session idle timeout value
kexalgos Key exchange methods that are used to generate per-connection keys <<<<<<<<<
key Generate SSH Key
keytypes Public key algorithms that the server can use to authenticate itself to the client
login-attempts Set maximum login attempts from ssh
login-gracetime Set login gracetime for ssh connection
macs Message authentication codes used to detect traffic modification <<<<<<<<<
port Set port number for ssh
rekey Renegotiate ssh key
switch(config)# ssh ciphers ?
WORD Algorithm name to be configured (Max Size 128)
aes256-gcm <Deprecated> enable aes256-gcm
all Control known weak SSH algorithms in current version of NX-OS in addition to the base set of strong algorithms
switch(config)# ssh macs ?
WORD Algorithm name to be configured (Max Size 128)
all Control known weak SSH algorithms in current version of NX-OS in addition to the base set of strong algorithms
switch(config)# ssh kexalgos ?
WORD Algorithm name to be configured (Max Size 128)
all Control known weak SSH algorithms in current version of NX-OS in addition to the base set of strong algorithms
مثال CLI من محول يشغل 10.3(6):
switch(config)# ssh kexalgos ?
all Enable algorithms supported in current version of SSH
ecdh-sha2-nistp384 Enable ecdh-sha2-nistp384
switch(config)# ssh ciphers ?
aes256-gcm Enable aes256-gcm
all Enable algorithms supported in current version of SSH
switch(config)# ssh macs ?
all Enable algorithms supported in current version of SSH
هناك شفرة إضافية، MAC، وخوارزميات KexAlgorithms التي يمكن إضافتها إذا تطلب الأمر:
switch(config)# ssh kexalgos [all | key-exchangealgorithm-name]
switch(config)# ssh macs [all | mac-name]
switch(config)# ssh ciphers [ all | cipher-name ]
ملاحظة: تتوفر هذه الأوامر على Nexus 7000 مع الإصدارات 8.3(1) والإصدارات الأحدث. بالنسبة للنظام الأساسي Nexus 3000/9000، يصبح الأمر متوفرا مع الإصدار 7.0(3)I7(8) والإصدارات الأحدث. (تتضمن جميع إصدارات 9.3(x) هذا الأمر أيضا. راجع دليل تكوين أمان Cisco Nexus 9000 Series NX-OS، الإصدار 9.3(x) )
المراجعة | تاريخ النشر | التعليقات |
---|---|---|
1.0 |
01-Jul-2024
|
الإصدار الأولي |