تمرين - اختبار الجهاز الظاهري الجديد

مكتمل

عند إنشاء جهاز ظاهري، يتم تعيين عنوان IP عام يمكن الوصول إليه عبر الإنترنت وعنوان IP خاص مستخدم داخل مركز بيانات Azure. تظهر كلا هاتين القيمتين في كتلة JSON التي create يعيدها الأمر، كما يلي:

{
   ...
  "privateIpAddress": "10.0.0.4",
  "publicIpAddress": "40.83.165.85",
   ...
}

الاتصال بجهاز ظاهري باستخدام SSH

يمكننا أن نتحقق بسرعة من أن جهاز Linux الظاهري يعمل بشكل جيد باستخدام عنوان IP العام في أداة Secure Shell (ssh). تذكر أننا قمنا بتعيين اسم المسؤول إلى azureuser، لذلك نحتاج إلى تحديد ذلك. تأكد من استخدام عنوان IP العام من المثيل قيد التشغيل.

ssh azureuser@<public-ip-address>

إشعار

لا نحتاج إلى كلمة مرور لأننا أنشأنا زوج مفاتيح SSH كجزء من إنشاء الجهاز الظاهري. في المرة الأولى التي تستخدم فيها Shell في جهاز ظاهري، ستتلقى مطالبة بشأن أصالة المضيف.

وذلك لأننا نحاول الوصول إلى عنوان IP مباشرة، بدلًا من الوصول إليه عن طريق اسم مضيف. ستؤدي الإجابة بـ «نعم» إلى حفظ عنوان IP كمضيف صالح للاتصال والسماح بمتابعة الاتصال.

The authenticity of host '40.83.165.85 (40.83.165.85)' can't be established.
RSA key fingerprint is SHA256:hlFnTCAzgWVFiMxHK194I2ap6+5hZoj9ex8+/hoM7rE.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '40.83.165.85' (RSA) to the list of known hosts.

بعد ذلك، سيتم تقديمك مع shell عن بعد حيث يمكنك إدخال أوامر Linux.

Welcome to Ubuntu 18.04.3 LTS (GNU/Linux 5.0.0-1014-azure x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Wed Aug 21 20:32:04 UTC 2019

  System load:  0.0               Processes:           108
  Usage of /:   4.2% of 28.90GB   Users logged in:     0
  Memory usage: 9%                IP address for eth0: 10.0.0.5
  Swap usage:   0%

0 packages can be updated.
0 updates are security updates.

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

azureuser@SampleVM:~$

جرب بعض الأوامر، مثل ps أو ls كممارسة. عند الانتهاء، قم بتسجيل الخروج من الجهاز الظاهري عن طريق الكتابة exit أو logout.