Trojaned - سه - الخفي - عنصر hwclock ثنائي - خيارات
هذه المقالة جزء من سلسلة باكوبيورسيستم. ويمكن الاطلاع على مزيد من المعلومات التمهيدية هناك. إنترودكتيون من صفحة الرجل: رسينك هو أداة نسخ الملفات سريعة وغير عادية للغاية. يمكن نسخ محليا، تفروم مضيف آخر على أي قذيفة عن بعد، أو تفروم الخفي رسينك البعيد. فإنه يوفر عددا كبيرا من الخيارات التي تتحكم في كل جانب من جوانب سلوكها وتسمح مواصفات مرنة جدا من مجموعة من الملفات التي سيتم نسخها. وهي تشتهر بخوارزمية دلتا-ترانسفر التي تقلل من كمية البيانات المرسلة عبر الشبكة عن طريق إرسال الاختلافات بين ملفات المصدر والملفات الموجودة في الوجهة فقط. يستخدم على نطاق واسع رسينك للنسخ الاحتياطي والمطابقة وكأمر نسخة محسنة للاستخدام اليومي. وبعبارة أخرى، رسينك هو أداة لنسخ بكفاءة والنسخ الاحتياطي للبيانات من موقع واحد (المصدر) إلى آخر (الوجهة). وهو فعال لأنه ينقل الملفات التي تختلف بين الدلائل المصدر والوجهة فقط. رسينك هو أداة سطر الأوامر. يجب أن يكون المستخدمون الذين يحاولون استخدامه على دراية بسطر الأوامر (راجع استخدام المحطة الطرفية). إذا كنت تفضل واجهة رسومية، فراجع قسم غرسينك من هذه الصفحة. تثبيت تثبيت رسينك في أوبونتو بشكل افتراضي. تأكد من التحقق من تثبيت الحزم التالية قبل البدء (انظر تثبيت حزمة): رسينك، زينيتد، سش. إجراء نسخة احتياطية بسيطة أبسط طريقة لعمل نسخ احتياطي عبر الشبكة هي استخدام رسينك عبر سش (باستخدام الخيار - e سش). بدلا من ذلك، يمكنك استخدام رسينك ديمون (انظر رسينك ديمون الذي يتطلب تكوين أكثر من ذلك. النسخ الاحتياطي المحلي يتطلب فقط رسينك و ريادوريت الوصول إلى المجلدات التي تتم مزامنتها أدناه ستجد أمثلة الأوامر التي يمكن استخدامها للنسخ الاحتياطي في كلتا الحالتين وتجدر الإشارة إلى أن مزامنة الشبكة يمكن أن يؤديها محليا طالما يتم تقاسم المجلد (يقول سامبا) ومن ثم شنت على الجهاز مع folder1. هذه العملية يحصل حول الحاجة إلى استخدام سش ولكن هو أقل أمنا ويجب أن تستخدم فقط في شبكات خاصة آمنة، مثل في منزلك النسخ الاحتياطي عبر الشبكة شرح الخيارات أعلاه للأوامر: --dry تشغيل هذا يروي رسينك أن لا تفعل أي شيء في الواقع، وسوف مجرد كتابة سجل ما سوف تفعله على الشاشة. بمجرد التأكد من كل شيء سوف تعمل كما تتوقع، لديك لإزالة هذا الخيار، وتشغيل الأمر مرة أخرى لإجراء النسخ الاحتياطي الفعلي - حذف حذف حذف الملفات التي لا وجود لها على النظام الذي يتم احتياطيا. (اختياري) - يحافظ على التاريخ و t إيميس، وأذونات الملفات (نفس - rlptgoD). مع هذا الخيار سوف رسينك: تنزل بشكل متكرر في جميع الدلائل (-r)، نسخ الارتباطات سيمبلينكس (-l)، والحفاظ على أذونات الملف (-p)، والحفاظ على أوقات التعديل (-t)، والحفاظ على ملكية ملف (-o)، و - z يضغط البيانات - vv يزيد من فيربوسيتي من عملية الإبلاغ - e يحدد قذيفة عن بعد لاستخدام folder1 و folder2 في الأمثلة أعلاه، folder1 و 2 هي العناصر النائبة للدلائل لتكون متزامنة. Folder1 هو المجلد الأصلي، و 2 هو المجلد الجديد، أو المجلد الموجود ليتم مزامنته مع الأول. استبدلها بالمجلدات التي تعجبك. تمت إضافة A بعد المجلد 1 بحيث يتم نقل المحتويات فقط، بدلا من المجلد الكامل، إلى المجلد الثاني. يمكن العثور على ملخص كامل لجميع الخيارات مع الأمر رسينك في صفحات الرجل ضمن ملخص الخيارات. يمكن العثور على صفحة الرجل ل رسينك أيضا على linux. die غرسينس هو واجهة المستخدم الرسومية واجهة الأداة المساعدة رسينك. واجهة بسيطة من واجهة المستخدم الرسومية يعرض العديد من الخيارات الأساسية المتاحة مع رسينك. ومن المفيد لأولئك الذين يفضلون عدم استخدام سطر الأوامر. التثبيت لا يتم تثبيت غرسينك البرنامج بشكل افتراضي على أوبونتو أو أي ديستروبتيون أخرى ولكنها متاحة بسهولة من المستودعات الرئيسية. للحصول على غرينك تأكد من تمكين قسم الكون من مستودعات أوبونتو في مصادر البرامج. ثم لتثبيت هذا البرنامج في أوبونتو، قم بتثبيت الحزمة التالية. غرسينك. التكوين لبدء غرسينك من خلال القوائم التالية: تطبيقات --gt أدوات النظام --gt غرسينك. عند البدء يتم عرض يول مع النافذة الرئيسية، حيث كل التكوين يأخذ مكان. على هذه النافذة هي كل الخيارات معظم المستخدمين سوف تحتاج أي وقت مضى. لشرح، سيتم سرد الخيارات وآثارها المذكورة. الجلسات - هذه الوظيفة هي نفس الملفات الشخصية في الآخرين. ستخزن كل جلسة مجموعة مختلفة من أدلة المصدر والوجهة، بالإضافة إلى خيارات التهيئة المقترنة بزوج المجلد. وهذا يسمح لمزامنة مجموعات مختلفة من المجلدات وفقا لخيارات مختلفة. إدارة جلسات بسيطة، ببساطة الضغط على زر إضافة لإضافة واحدة جديدة. للحذف، حدد الجلسة التي لم تعد تريدها من القائمة المنسدلة ودفع حذف. المصدر والوجهة - يدرج هذان المربعان المجلدين (المشار إليهما تقنيا باسم الدلائل) التي ستتم مزامنتها. أعلى واحد هو المصدر وأسفل الوجهة. لذلك عند تنفيذ المزامنة، سيتم نسخ الملفات من المصدر إلى الوجهة وفقا للخيارات التي يختارها المستخدم. لتحديد الدلائل إما تصفح لهم من واجهة المستخدم الرسومية أو اكتب لهم وفقا لمعايير المسار القياسية. التبديل - علامة إعادة تحميل عالمية تقع إلى يمين الأزرار تصفح هو زر مفيد. وسوف تتحول على الفور المصدر مع الوجهة. الاستيراد والتصدير - بعد تكوين الجلسات، قد يرغب المستخدم في الاحتفاظ بنسخة احتياطية منه للتخزين. لإجراء ذلك، ما عليك سوى الانتقال إلى قائمة الجلسات في الجزء العلوي وتحديد إما استيراد أو تصدير. الأول سوف استعادة جلسة من نسخة احتياطية سابقة، فإن هذا الأخير جعل نسخة احتياطية من الدورة الحالية. ملاحظة: تعمل وظيفة النسخ الاحتياطي هذه على أساس كل جلسة. وهذا يعني أنه يجب تحديد كل جلسة تريد الاحتفاظ بنسخة احتياطية منها من القائمة المنسدلة ثم الاحتفاظ بنسخة احتياطية منها. إذا كان لديك 3 جلسات مختلفة، حدد كل بدوره وتصديرها. نفس الشيء عند استيراد الجلسات. الخيارات الأساسية - معظم المستخدمين سوف تجد معظم الخيارات التي سوف تحتاج من أي وقت مضى هنا. وستحافظ الأربعة الأولى على خصائص الملفات المنقولة. سيقوم الآخرون بتعديل كيفية نسخ الملفات. لمزيد من المعلومات حول ما كل على وجه التحديد، تحوم المؤشر الثابت الخاص بك على الخيار، وسوف يعرض تفسيرا صغيرا. الخيارات المحددة هي بالطبع تلك التي سيتم تطبيقها خلال الدورة. خيارات متقدمة - يحمل هذا التبويب المزيد من الخيارات، وكثير مفيدة وذاتي التفسير. بالنسبة لأولئك الذين لا يفهمون، سيتم عرض تلميحات الأدوات عندما يبقى الماوس على خيار طويل بما فيه الكفاية. خيارات إضافية - يتيح مربع الإدخال هذا إدخال خيارات إضافية غير مقدمة في واجهة المستخدم الرسومية ولكن معروفة للمستخدم. يقترح استخدام فقط للمستخدمين ذوي الخبرة، وإدخال خيارات مشوهة قد يكون لها عواقب غير متوقعة. المحاكاة والتنفيذ آخر اثنين من الأزرار على النافذة هي محاكاة وتنفيذ. زر المحاكاة مفيد جدا عندما يكون غير مؤكد ما سيحدث استنادا إلى الخيارات المحددة. ستظهر نافذة حوار النقل العادي، وفي القائمة الرئيسية، يتم سرد قائمة بالملفات التي تم نسخها. يمكن للمستخدم ثم التحقق إذا كان هذا هو المطلوب أو إجراء تغييرات. بمجرد بدء الجلسة باستخدام زر التنفيذ، سيظهر مربع الحوار مرة أخرى ولكن هذه المرة سوف يعالج المجلدات وفقا لذلك. تأكد قبل دفع تنفيذ أن كنت سعيدا مع المحاكاة. النسخ الاحتياطي النسخ الاحتياطي عن بعد عبر شبكة ممكنة، ويفضل أن المستخدم تحميل حصة الشبكة إلى أن يكون احتياطيا قبل بدء البرنامج. ثم سيتم سرد حصة في استعراض واجهة المستخدم الرسومية ويمكن بسهولة أن تضاف. لا يوجد قسم منفصل للشبكة، إذا كانت هناك حاجة إلى المزيد من الميزات المتقدمة يتم تشجيع المستخدم للنظر في البدائل، والتي يوجد العديد منها. البدائل هناك العديد من البدائل، في مراحل مختلفة من التنمية. للحصول على قائمة غير مكتملة، انظر هنا. رسينك ديمون الخفي رسينك هو بديل ل سش للنسخ الاحتياطي عن بعد. على الرغم من أن أكثر صعوبة لتكوين، فإنه لا توفر بعض الفوائد. على سبيل المثال، يتطلب استخدام سش لإجراء نسخ احتياطي عن بعد لنظام كامل أن الخفي سش يسمح بتسجيل الدخول إلى الجذر، والذي يعتبر خطرا على الأمان. استخدام رسينك الخفي يسمح لتسجيل الدخول الجذر عبر سش إلى تعطيل. تكوين شيطان رسينك 1. تحرير ملف إزدفولترسينك لبدء رسينك كما الخفي باستخدام زينيتد. يجب أن يتم تغيير الإدخال الوارد أدناه من خطأ إلى إينيتد. 2. تثبيت زينيتد لأنه لم يتم تثبيت افتراضيا. 3. إنشاء ملف etc. xinetd. drsync لإطلاق رسينك عبر زينيتد. وينبغي أن تحتوي على سطور النص التالية. 4. إنشاء ملف تكوين esrsyncd. conf ل رسينك في وضع الخفي. يجب أن يحتوي الملف على ما يلي. في الملف، يجب استبدال المستخدم باسم المستخدم على الجهاز البعيد الذي يتم تسجيل الدخول إليه. 5. إنشاء etrsyncd. secrets للمستخدمين كلمة المرور. يجب أن يكون المستخدم هو نفسه كما هو موضح أعلاه، مع كلمة المرور واحد يستخدم لتسجيل الدخول إلى الجهاز البعيد كما المستخدم المشار إليه. 6. هذه الخطوة تعيين أذونات الملف rsyncd. secrets. 7. ستارترستارت زينيتد تشغيل الأمر التالي للتحقق مما إذا كان كل شيء على ما يرام. الإخراج المذكور هو مجرد عينة، يجب أن يكون ما هو على جهاز مشترك عن بعد. يمكن استبدال اسم المضيف بعنوان إب الخاص بالجهاز. النسخ الاحتياطي مع رسينك و سش (التمرير إلى أسفل إذا كنت تريد ملخصا بالمعلومات أقل بكثير من ما سيتم تغطيتها) عندما بدأت أول ترقيع مع هذه الفكرة، وكل شيء سش نوع من الخلط بيني، في الغالب لأنني لم أكن أعتقد سش سيكون من السهل للمستخدم النهائي للاستفادة. في حين أن سش معقدة جدا في التصميم، جعلت من السهل السوبر للمستخدم النهائي لإعداد مجموعة مفتاح المصادقة. أساسا، سش هو 1-1 اتصال مصادقة يمكن الحصول عليها دون كلمة مرور. مرة واحدة هذا هو في مكان، يمكنك الاستفادة رسينك لتشغيل تلقائيا. قبل أن نبدأ، يرجى التأكد من تثبيت خادم أوبينشش على خادم الملفات المعني. بعد ذلك، نحتاج إلى إعداد زوج مفاتيح. سوف تتلقى مفتاح عمومي ومفتاح خاص. سوف يطلب منك بعض الأسئلة، مثل ما إذا كنت تريد أو لا تريد كلمة مرور لزوج المفاتيح، الخ اخترت لا وأساسا ترك كل شيء آخر الافتراضي. ذهبت مع أي كلمة مرور لأن مفاتيح سش هي جميلة - آمنة، بالإضافة إلى أردت أن يكون هذا الآلي. لم أكن متأكدا من كيف يمكن أتمتة هذه العملية في حين لا يزال وجود كلمة مرور على ذلك. يجب نسخ المفتاح العمومي إلى ملف أوثوريزكيس على الخادم. بفضل أمر مفيد، وهذا غير مؤلم. استبدل jason192.168.1.150 بما سيكون عليه الإعداد. إيتل يطلب منك كلمة المرور الخاصة بك. ضع كلمة المرور لحساب المستخدم الذي يتم المصادقة عليه على خادم الملفات. وبمجرد القيام به، يجب أن تكون قادرا على تشغيل: إذا لم يكن طلب كلمة مرور وتغيير موجهتك، كنت جيدة للذهاب. إذا طلب منك كلمة مرور، فمن المحتمل أن يكون هناك شيء. يرجى ملاحظة، إذا كنت تعبث مع مفاتيح سش (عن طريق حذفها، إضافة جديدة، وما إلى ذلك) إيتل تتطلب إعادة التشغيل (بعض الناس قد قال لي تسجيل الخروج تسجيل الدخول يعمل بشكل جيد جدا) لإعادة تعيين. أنا لا أعرف ما يكفي عن ذلك لشرح ما يحدث إلى جانب أخذ تخمين المتعلمين أن مفتاح سش هو الحصول على تأمين إلى جلسة العمل الخاصة بك. إلا إذا كنت تخطط للعبث حول كما فعلت، حيث أود أن حذف مفاتيح سش وإعادة توليدها مرارا وتكرارا لأغراض التعلم، لن تواجه هذه المسألة. ولكن إذا كنت تفعل، أردت أن رمي هذا هناك. لذلك، يتم تعيين سش حتى وكنت جيدة للذهاب. الآن ما رسينكس بدوره. لقد فتحت الباب مع سش، الآن تحتاج إلى وضعها في العتاد مع رسينك. رسينك هو أداة تزامن عن بعد. لاستخدامات بلدي، لها رهيبة إلى حد كبير جدا. أقترح عليك الناس قراءة صفحة رجل رسينك لمزيد من المعلومات. مجرد ملاحظة جانبية، أي شخص يقرأ هذا الذي يستخدم لينكس، يرجى الحفاظ على صفحات الإنسان في الاعتبار. إنها أسرع من غوغل. بكل صراحه. يمكنك قراءتها عن طريق الذهاب إلى محطة وكتابة رجل رسينك. بالطبع، يمكنك استبدال رسينك لأي أمر آخر لقراءة المزيد عن ذلك أيضا، ويعرف أيضا باسم الرجل كب وغيرها من صفحة الرجل سوف تذهب على وظائف مجموعة من الأعلام. ثيريس عدد قليل أنا شخصيا استخدام و سوء تغطية لهم في كلماتي أدناه. - وضع الأرشيف. هذا يحافظ على الوقت، الأذونات، المالك، مجموعة، وإعدادات مختلفة أخرى نفس المصدر. أنا أحب استخدام - a لأنه يضمن أن البيانات الخاصة بي على ملقم ملف تطابق البيانات الخاصة بي على سطح المكتب، حتى وصولا الى الذين يمتلكون ما والطوابع الزمنية. - z ضغط الوضع. أنا لم تستخدم حقا هذا حتى وقت قريب. أنا لست متأكدا إذا لاحظت اختلافا لأن رسينك هو سريع جدا لتبدأ، ولكن أنا معالجته في هناك، ومعظمهم بسبب، لماذا لا - استبعاد وضع استبعاد. هذا هو إذا كنت ترغب في استبعاد دليل معين، المهملات، أشرطة الفيديو، الخ على سبيل المثال، دعنا نقول كنت ترغب في استبعاد كافة الملفات المخفية. ستفعل --exclude. لاحظ بعد علامة يساوي هناك فترة وهذا يضمن كنت تفعل بطاقة البرية، وهذا يعني كل شيء، ولكن فقط بعد هذه الفترة. منذ بدأت ملفات الملفات المخفية مع فترة، يمكنك ان ترى كيف يمكن أن تشمل. folder1.folder2.folder3، الخ ملاحظة - شخصيا، أود أن أوصي بالتأكيد باستثناء. gvfs. غفس هو نظام الملفات الظاهرية غنوم. وهو يعمل أساسا كنقطة جبل لموارد الشبكة. يتيح القول خادم الملفات الخاص بك يمكن الوصول إليها من خلال. gvfs. إذا كنت رسينك كل شيء ولا تستبعد. gvfs، كنت في جوهر تكرار البيانات على ملقم الملفات الموجودة بالفعل، لأنه موجود في المجلد الأساسي، وكذلك من خلال. gvfs بفضل خادم الملفات. homejasonDocuments homejasonMusic homejasonPictures homejason. gvfsDocuments homejason. gvfsMusic homejason. gvfsPictures باستبعاد. gvfs، يمكنك تجنب هذا معا. إذا كنت النسخ الاحتياطي دليل المنزل، إد تشير إلى القيام بذلك. باستخدام ببساطة --exclude. gvfs يعمل بالنسبة لي، ولكن إذا كنت في حاجة إلى المسار الكامل، فإنه سيكون بالطبع --excludehomejason. gvfs --delete هذا سيحذف الملفات على الوجهة التي لا وجود لها على المصدر. لنفترض أن لديك مجلد يحتوي على 100 غيغابايت من البيانات وبياناته المسماة ببساطة. إذا قمت بإعادة تسميته إلى data2، فإن الخادم الخاص بك يحتوي على نسخة من البيانات والبيانات 2 المجموع الكلي من 200 غيغابايت. إذا كنت تريد أن تكون البيانات على الخادم الخاص بك متطابقة، استخدم --delete. إذا كنت تريد أن يكون نوعا من التكرار الملف القديم (وأنا أعلم أن بعض الناس يفضلون هذا)، لا تستخدم --delete. --progress إذا قمت بتشغيل رسينك يدويا، سيكون قادرا على رؤية تقدم ما يحدث بدلا من مجرد مؤشر وامض. أنا فقط استخدام هذه العلم إذا كنت ترغب في تشغيل الأمر يدويا ونرى ما تقوم به. أنا لا أزعج استخدام هذا عندما شوتيمي وأريد ذلك الآلي في الخلفية. بخلاف ذلك، عن مجرد إنشاء المصدر والمقصد. دعونا نبدأ مع الوجهة، لأنه بعد كل شيء، تم ترقيع مع سش هنا حتى لها قليلا صبي قليلا. بالنسبة للوجهة، ستحتاج إلى المستخدم والخادم ومسار المجلد. كما قلت، اسمي جايسون، وملقم ملفي هو 192.168.1.150. مسار المجلد الخاص بي على خادم بلدي على وجه الخصوص هو ميدياسجاسون. في حالتي، ناس هو محرك الشبكة التي شاركت بها، لذلك لها محددة جدا لوضعي. من المرجح أن تختلف. خياط الوجهة إلى الوضع الخاص بك. إذا كان محرك النسخ الاحتياطي الخاص بك هو ميدياستوراج لديك مجلد على تخزين اسمه صريح، ثم استخدام ميدياستوراجورانك، وما إلى ذلك في حالتي: هو وجهتي. الآن، عن المصادر. أنها بسيطة بما فيه الكفاية، كما هو نفسه أعلاه باستثناء أنها لا تشمل وسيرفرر. إذا كنت تريد مزامنة الدليل الرئيسي بأكمله، يمكنك القيام بذلك فقط: إذا كنت تريد مزامنة الدليل الرئيسي بأكمله ولكن مع استبعاد. gvfs وعلم --delete، استخدم: الحصول على جيست منه الآن ملاحظة، يمكن أن يكون لديك مصادر متعددة أيضا، مما يجعل من مفيد إذا كنت تريد فقط لعمل نسخة احتياطية من عدد قليل من المجلدات المحددة إلى ملقم الملفات. في حالتي، كان لدي مساحة محدودة لملقم الملفات، لذلك أردت فقط أن النسخ الاحتياطي للبيانات الأكثر أهمية لملقم ملفي، والتي بالنسبة لي هو الوثائق والصور. مثال: يمكنك بعد ذلك إعداد وظيفة كرون لهذا لتشغيلها في أوقات محددة. أنا أبدا تشغيل رسينك كجذر، لذلك عندما أقوم بإعداده في كرون أنا تعيينه لإطلاق كما جيسون والموسومة فقط الأمر رسينك أعلاه في. إيف منذ الابتعاد عن الطريق كرون. أغلقت جهاز الكمبيوتر الخاص بي في الليل، ولكن ملقم ملف بلدي يبقى في كل وقت، وأضافت إدخال في تطبيقات بدء التشغيل للقيام النسخ الاحتياطي بالنسبة لي، وهو مفيد لأنه يعمل عند بدء تشغيل النظام. أنا اسمه ناس النسخ الاحتياطي ووضع الأمر أعلاه في مجال الأمر. كل شيء يعمل مثل سحر مع صفر المدخلات المطلوبة من لي. imagessmiliesguitar. gif نصيحة سريعة، إذا أردت أن تحقق من رسين رسومات لائقة، النار حتى غرسينك. لها سهلة الاستخدام وسوف تساعدك على هيكلة أمر رسينك إذا كنت غير متأكد تماما فقط حتى الان. فقط لاحظ، لا يوجد --exclude العلم في واجهة المستخدم الرسومية، لذلك عليك أن تضيف يدويا تحت خيارات إضافية، ولكن هذا جميلة - من السهل القيام به. غرسينك أيضا لا تستخدم - أ، ولكن بدلا من ذلك يكسر - أ إلى - t - o - p - g الخ قراءة صفحة رجل رسينك تحت - أ القسم لمعرفة لماذا هذا يجعل الفرق ليتلينو. مرة واحدة كنت قد وضعت بالطريقة التي تريدها، يمكنك أيضا القيام بتشغيل الاختبار، والتي هي واحدة من ميزات غرسينك للتأكد من أنها تعمل بشكل صحيح قبل إعطائها الضوء الأخضر. على افتراض كل شيء بشكل جيد وأنت فعلت، يمكنك جدولة هذه المهمة غرسينك مع، كنت تفكر في ذلك، إما تطبيقات بدء التشغيل أو كرون. نضع في اعتبارنا، بناء الجملة هو غرسينك - e اسم المهمة. حتى إذا قمت بتسمية النسخ الاحتياطي وظيفة، تشغيل تشغيل النسخ الاحتياطي غرسينك - e. سيكون هذا هو نفسه لتطبيقات كرون أو بدء التشغيل. اختبرت تشغيله في تطبيقات بدء التشغيل. ويأتي مع نافذة واجهة المستخدم الرسومية عند تسجيل الدخول في تبين لي حالة نقل البيانات. إذا ذهبت الطريق مع تطبيقات بدء التشغيل ورمي مجرد أمر رسينك الكامل في، فإنه يفعل ذلك تماما في الخلفية. اعتمادا على مقدار الوضع المرئي الذي تريده قد يملي الطريق الذي تذهب إليه. على أي حال، كودوس خطيرة لفريق سش، رسينك، وغرسينك، كما أنها تخمر بعض تقنيات مثيرة للإعجاب جدا هنا. وكان المقصود أعلاه أن تكون السوبر بالمعلومات. آمل أن بعض المستخدمين يمكن إعداد نظام النسخ الاحتياطي الذي يعمل بالنسبة لهم. نضع في اعتبارنا، أنت لا تعرف متى السيد هاردريف ذاهب للدبابات عليك، لذلك تخطط للمستقبل. وفيما يلي ملخص الخام لما تقوم به للمستخدمين الذين لا يريدون قراءة من خلال جبل من النص. ملاحظة: تغيير الإعدادات أدناه لتتناسب مع الإعداد الخاص بك، إلا إذا كان اسمك يحدث أن يكون جاسون وملقم الملف الخاص بك يحدث أن يكون 192.168.1.150. تطبيقات بدء تشغيل العميل - حدد جديد - اسمه النسخ الاحتياطي أو ما يرضيك، وإضافة خط رسينك المطلوب في مربع الأمر، مثل: ستيف فريدلز ونيكسويز نصائح تقنية وقد نفذ العديد من المستخدمين تأمين شل (سش) لتوفير الوصول المحمي إلى لينكس عن بعد ، ولكن لا يدركون أنه من خلال السماح مصادقة كلمة المرور، فإنها لا تزال مفتوحة لهجمات القوة الغاشمة من أي مكان على شبكة الانترنت. هناك الديدان تشغيل المستشري على شبكة الإنترنت التي تقوم بعمل فعال العثور على تركيبات أوزرنامباسورد ضعيفة، وهذه لا تتوقف عن طريق استخدام شل الآمنة. هذه التقنية تلميح تفاصيل كيفية استخدام العميل بوتي مجانا سش للاتصال بنظام لينكس تشغيل خادم أوبنسه، كل ذلك أثناء استخدام التشفير المفتاح العمومي ودعم سش وكيل. ينطبق الكثير من هذه المعلومات على أي تركيب أوبنسه على أي نظام أونيكس - سولاريس، بسد، أوبنسرفر - لكننا استهدفنا هذا إلى منصة لينكس عندما يتم استدعاء التفاصيل. التركيب و كونفيغلوجين بسيط توفير كامل باسوردليس، القائم على وكيل الوصول يتطلب الكثير من الخطوات، لذلك تقترب جيدا هذا في الخطوات من خلال توفير لأول مرة للوصول إلى كلمة المرور العادية للنظام. وهذا يسمح لاختبار التثبيت الأولي والقدرة على تسجيل الدخول قبل تمكين الميزات أكثر تقدما. تحميل وتثبيت البرامج على عكس معظم برامج ويندوز، لا يتطلب جناح بوتي مثبت: يتم إسقاط الملفات. EXE الفردية ببساطة في دليل حيث يتم تشغيلها مباشرة. نحن نعجب الاقتصاد والأناقة التي يوضح المؤلف بوتيز. يمكن إسقاط الملفات في أي دليل الذي هو في مسار الأمر المستخدمين، ونحن عادة استخدام C: بن (انظر البند التالي لكيفية تكوين هذا). يجب تحميل خمسة ملفات من موقع بوتي. BTTY. exe مداش عميل آمن شل PuTTYgen. exe مداش سش مولد مفتاح بوبليكفيريفات Pagent. exe مدش سش عامل رئيسي PSCP. exe مداش نسخة آمنة من سطر الأوامر PSFTP. exe مداش نسخة آمنة مع واجهة مثل فتب تأكد من أن دليل التثبيت في الأمر المسار على الرغم من إمكانية تشغيل بوتي مع مسار كامل أو اختصار، في الممارسة مفيدة لها عندما يكون متوفرا تماما في موجه سمد للوصول إلى أو نسخ الملفات من أي مكان في نظام الملفات. انقر بزر الماوس الأيمن فوق جهاز الكمبيوتر على سطح المكتب وحدد خصائص. انقر على علامة التبويب خيارات متقدمة في الجزء العلوي، ثم انقر على الزر متغيرات البيئة. هذا إحضار مربع الحوار هو مبين على اليمين. هناك دائما متغير باث في قسم متغيرات النظام، وأحيانا في قسم متغيرات المستخدم أيضا. فقط المسؤولين الوصول إلى متغيرات النظام، لذلك تحرير أو إضافة باث كما هو مطلوب. نحن عادة وضع الدليل الجديد في بداية المسار، وفصلها عن بقية القائمة مع فاصلة منقوطة. انقر فوق موافق لحفظ كافة التغييرات. إنشاء اختصار على سطح المكتب بوتي غالبا ما تستخدم بكثافة من قبل عامل تكنولوجيا المعلومات، لذلك من المفيد أن يكون اختصار على سطح المكتب لجعل لسهولة الوصول إليها. لإضافة هذا، انقر بزر الماوس الأيمن على سطح المكتب وانقر على اختصار جديد. إما تصفح إلى، أو اكتب في اسم مسار مسار بوتي القابل للتنفيذ. في مثالنا، كان C: binputty. exe. انقر فوق موافق وإعطاء اختصار اسم مناسب. إطلاق بوتي وتكوين للنظام الهدف إطلاق بوتي عن طريق الاختصار، وأنه سيتم عرض مربع الحوار التكوين: هناك العديد من الخيارات هنا. ملء جيدا في عدة لتوفير الوصول إلى كلمة السر إلى النظام، ثم تكوين للوصول العمومي مفتاح في وقت لاحق. الفئة: اسم المضيف: دبسيرفر بروتوكول: () اتصال سش. بيانات تسجيل الدخول التلقائي اسم المستخدم: ستيف الاتصال. بروتوكول سش المفضل سش الإصدار: () 2 فقط بمجرد إدخال هذه الإعدادات البسيطة، يمكن حفظها لجعلها سهلة الوصول في المرة القادمة. انقر على الجلسة على اليمين، ثم أدخل اسما في الجلسات المحفوظة - عادة ما يكون هذا الاسم مرتبطا بالجهاز الذي تتصل به. انقر فوق حفظ لتخزين هذه الإعدادات في التسجيل: ويف اختر اسم خادم قاعدة البيانات. تسجيل الدخول مع الإعدادات المحفوظة من الخطوة السابقة، ويد ترغب في استخدامها للاتصال النظام المستهدف. إطلاق بوتي (إذا لم يكن مفتوحا بالفعل)، وفي قسم جلسة، انقر على اسم الدورة المحفوظة وانقر فوق تحميل. انقر فوق فتح لتشغيل الاتصال. عند المطالبة، أدخل كلمة المرور لحسابك على النظام البعيد، وإذا كان صحيحا، فستحصل على قذيفة. الآن يمكنك البدء في العمل على النظام. ومع ذلك - في كل مرة يربط بوتي مع خادم، فإنه يتبادل تحديد في شكل مفاتيح المضيف. إذا كان مفتاح المضيف غير معروف، أو لا تتطابق مع ما رأيناه سابقا، فإنه يحذر المستخدم. بالنسبة للمضيفين غير المعروفين، يكون هذا في الغالب عملية شكلية، ولكن بالنسبة للنظم المعروفة سابقا، قد يوحي بأن المضيف ليس هو نفسه كما كان متصلا في الأصل. مفاتيح المضيف التي تغيرت دون سابق إنذار يمكن أن تحدث عندما يتم إعادة تثبيت نظام التشغيل الهدف دون استعادة مفاتيح المضيف من النسخ الاحتياطي، أو أنه يمكن أن يكون شيئا أكثر شائنة مثل مضيف المارقة تنكر باعتبارها واحدة حقيقية. يجب على المرء دائما الاستفسار عن مفاتيح المضيف غير المتغيرة بشكل غير متوقع إنشاء واستخدام جلسات متعددة عندما يحتاج المستخدم فقط للاتصال مع نظام واحد، من الممكن للبرمجة في هذه المعلمات في الجلسة الافتراضية، ولكن أكثر شيوعا بكثير للوصول إلى أنظمة متعددة. مع القليل من الإعداد، يمكننا بسهولة إنشاء والاتصال بهذه الأنظمة بنقرة واحدة. إنشاء الجلسات وحفظها كما فعلنا في القسم السابق، قم بإنشاء وحفظ العديد من الجلسات المسماة حسب الحاجة، وتقديم ملاحظة لأسماء الجلسات. يمكن الإشارة إلى هذه الأسماء على سطر الأوامر مع المعلمة - load، ويمكن تضمينها في الاختصار. انقر بزر الماوس الأيمن على الاختصار وحدد خصائص، ثم أدخل المعلمة - load جنبا إلى جنب مع اسم الدورة (في علامات الاقتباس، إذا لزم الأمر). انقر فوق موافق لحفظ خصائص الاختصار. كما أنها فكرة جيدة لإعادة تسمية الاختصار لتعكس اسم الملقم الذي يتصل به: انقر بزر الماوس الأيمن على الاختصار وحدد إعادة تسمية. بمجرد تكوين الاختصار الدورة بالكامل، انقر نقرا مزدوجا فوق أيقونة تطلق الاتصال. إنشاء العديد من اختصارات مبرمجة مسبقا حسب الحاجة. إنشاء وتثبيت لوحة المفاتيح العامة العامة الطاقة الحقيقية من شل شل يأتي في اللعب عندما يتم استخدام مفاتيح القطاع العام. وخلافا لمصادقة كلمة المرور، يتم الوصول إلى المفتاح العمومي من خلال إجراء إنشاء لمرة واحدة من زوج من الأرقام الثنائية طويلة جدا التي ترتبط رياضيا. خطوة التكوين الأولي معتدلة المعنية، ولكن لا بد من القيام به مرة واحدة فقط: بمجرد إنشاء، يمكن تثبيت المفتاح بسهولة على العديد من النظم البعيدة على النحو المطلوب. تشغيل بوتيجن مطلوب زوج من مفاتيح بوبليكبيريفات مداش الملفات الصغيرة التي تحتوي على أعداد ثنائية كبيرة جدا مداش، و بوتيجن يفعل ذلك. تشغيلها مرة واحدة فقط لخلق زوج من المفاتيح الشخصية، والتي يتم تثبيتها عند الحاجة. انقر فوق ابدأ. ثم اركض . ثم أدخل بوتيجن في مربع سطر الأوامر. هذا يعرض مربع الحوار الرئيسي، يظهر على اليمين. حدد المعلمات الرئيسية كما هو موضح، ثم انقر فوق إنشاء. لأنه يتم إصلاح دسا كيسيز في 1024 بت، و رسا مفاتيح يمكن إجراء أكبر من ذلك بكثير، نوصي مفتاح رسا 2048 بت. لاحظ أن الافتراضي هو 1024 بت، يجب عليك تجاوز يدويا لتحديد 2048. ملاحظة: لا إنشاء مفتاح سش الإصدار 1 من أي نوع: أنها غير آمنة. سوف يطلب منك إنشاء بعض العشوائية عن طريق تحريك الماوس حولها: وهذا يعطي النظام بعض الإنتروبيا إضافية مما يساعد على خلق مفاتيح أفضل. هذا يستغرق سوى بضع ثوان لتوليد تماما كيباير. حماية وحفظ المفاتيح الآن تم إنشاء كيباير، ولكن موجود فقط في ذاكرة بوتيجنز: يجب أن يتم حفظها إلى القرص ليكون من أي استخدام. على الرغم من أن المفتاح العمومي لا يحتوي على معلومات حساسة وسيتم تثبيته على الأنظمة البعيدة، يجب حماية المفتاح الخاص بقوة: أي شخص يعرف المفتاح الخصوصي لديه تشغيل كامل لجميع الأنظمة البعيدة. يتم حماية المفتاح الخاص عادة باستخدام عبارة مرور، ويتم إدخال هذه العبارة مرتين في الحقول المشار إليها. التعليق اختياري ولكنه عادة عنوان البريد الإلكتروني لمالك المفتاح. ويمكن أيضا أن يكون مجرد اسم أصحاب. لا ننسى عبارة المرور لوحة المفاتيح لا طائل منه دون ذلك. يجب الآن حفظ المفتاح الذي تم إنشاؤه، ويتم ذلك في ثلاثة أجزاء: حفظ المفتاح العام وحفظ المفتاح الخاص على حد سواء موجه للحصول على اسم الملف، ويجب حفظ المفتاح الخاص (مع ملحق. ppk) في مكان آمن. المفتاح العمومي هو في شكل قياسي ويمكن استخدامها بشكل مباشر أو غير مباشر من قبل البرامج الأخرى، ويبدو هذا: المفتاح الخاص هو في شكل بوتي محددة التي لا يمكن استخدامها من قبل أي برنامج آخر. انها لن ينظر من أي وقت مضى في مباشرة من قبل المشغل. تثبيت المفتاح العمومي على نظام لينوكس مع بوتيجن لا يزال مفتوحا، تسليط الضوء على المفتاح العام بأكمله لصق في أوبنسه أذن منطقة ملف واكتب التحكم C لنسخ إلى الحافظة الأنظمة المحلية. هذا هو أساسا نفس البيانات الموجودة في ملف المفتاح العمومي المحفوظ، ولكن في شكل التي يمكن استخدامها مباشرة على نظام لينكس. تسجيل الدخول إلى الكمبيوتر لينكس باستخدام كلمة مرور الحسابات، إنشاء الدليل. ssh إذا لزم الأمر، ثم تحرير الملف. sshauthorizedkeys. سيكون هذا ملف نصي، ويجب لصق الحافظة فيه. المفتاح العام سيكون مجرد خط واحد طويل، و من السهل حقا لصق البيانات بطريقة تقطع الأحرف القليلة الأولى. هذا يجعل المفتاح غير قابل للعمل، لذلك تأكد من أن المفتاح يبدأ سش-رسا أو سش-دسا. حفظ الملف. تأكد من أن كل من الدليل. ssh والملفات الموجودة فيه يمكن قراءتها فقط من قبل المستخدم الحالي (وهذا هو الاحتياطات الأمنية)، وهذا يمكن تحقيقه باستخدام الأمر تشمود مع المعلمات تطبيق الدليل بأكمله: تسجيل الخروج من النظام. ملاحظة - يجب أن يكون مملوكا ملف أذن من قبل المستخدم وغير قابل للقراءة من قبل أي شخص آخر - خادم أوبنسه سوف ينكر تسجيل الدخول إذا لم يكن هذا هو الحال. يمكن للمرء أن تحقق هذا مع الأمر لس: يجب أن يكون الملف وضع - rw -------. إرفاق المفتاح الخاص لجلسة سش الآن بعد إنشاء لوحة المفاتيح العمومية الخاصة، يمكن ربطها بجلسة سش. أولا، وأيضا القيام بذلك في بوتي من خلال إطلاق البرنامج وتحميل الدورة من الفائدة. انتقل إلى اتصال. سش. أوث في جزء الفئة على اليسار، ثم قم بملء ملف المفتاح الخاص لحقل المصادقة من خلال التصفح إلى ملف. pk الذي تم حفظه مسبقا. ملاحظة - مع عملاء سيكور شل الآخرين، رأينا القدرة على إرفاق مفتاح خاص لجميع الجلسات (كجزء من التكوين العالمي)، ولكن مع بوتي يبدو أنه يتطلب تكوين لكل دورة. لم تكن متأكدا لماذا. ارجع الى مستوى فئة الجلسة وقم بحفظ الجلسة الحالية. عند هذه النقطة، بوتي (على ويندوز) و أوبنسه (على لينكس) على حد سواء تكوين لتأمين الوصول العمومي مفتاح. الاتصال عبر المفتاح العمومي الآن بعد أن تم الانتهاء من خطوات التكوين، كانوا على استعداد لتسجيل الدخول في الواقع باستخدام آلية المفتاح العمومي، وتجنب تماما خطوة كلمة المرور. قم بتوصيل بوتي بشكل آمن مع خيارات لتحميل الدورة المحفوظة مع المفتاح الخاص: بدلا من المطالبة بكلمة السر للحسابات (والتي سوف تختلف على كل نظام بعيد)، بدلا من ذلك يسأل عن عبارة المرور التي تحمي المفتاح الخاص المحلي. عندما يناسب المفتاح الخاص في المفتاح العمومي على خادم أوبنسه، الوصول الممنوح و قذيفة المقدمة للمستخدم. من المهم أن نلاحظ أنه على الرغم من أن المستخدم يجب كتابة كلمة سرية عند تسجيل الدخول، ويرتبط عبارة المرور مع المفتاح الخاص المحلي. لا حساب بعيد. حتى إذا تم تثبيت المفتاح العمومي للمستخدمين على 1000 خوادم بعيدة مختلفة، يتم طلب نفس عبارة المرور المفتاح الخاص لكل منهم. هذا يبسط إلى حد كبير مهمة تذكر أوراق اعتماد الوصول ويشجع اختيار قوية وآمنة منها. تعطيل مصادقة كلمة المرور على أوبنسه مرة واحدة يتم التحقق من المستخدمين كيباير العام والخاص على النحو الصحيح، من الممكن تعطيل مصادقة كلمة المرور على خادم لينكس تماما. هذا يحطم تماما كل محاولات كلمة السر التخمين الممكنة ويؤمن بشكل كبير الجهاز. ومع ذلك، بالنسبة للآلات لا المحلية جسديا، من الحكمة أن تؤجل على تعطيل مصادقة كلمة المرور حتى من الواضح تماما أن الوصول إلى مفتاح يعمل بشكل صحيح، وخاصة إذا كان يشارك العديد من المستخدمين. مرة واحدة تم تعطيل مصادقة كلمة المرور، حتى كلمة السر الجذر لن تسمح واحدة في النظام. ويتم تشجيع تلك الجديدة على الوصول إلى المفاتيح العامة لاختبارها بعناية فائقة. يتم العثور على تكوين سش الشيطان في ملف سشدكونفيغ، وغالبا ما يتم تخزينها في الدليل إتشش. هذا هو ملف نصي التي من السهل نسبيا أن تقرأ جيدا أن تبحث عن اثنين من إدخالات لتعديل. الأول هو تعيين باسوردوثنتيكاتيون إلى القيمة لا. قد يتم تعيين هذا بوضوح إلى نعم. or it may be commented out to rely on the default, but we wish to explicitly disable this: Second, we wish to disable SSH protocol version 1: this is old, has several substantial security weaknesses, and should not be allowed from the outside world. Edit the configuration file and ensure that the two keyword entries are set properly comment out the old entries if necessary. Once the configuration file has been saved, the Secure Shell daemon must be restarted on most platforms this can be done with the service mechanism: This kills the listening daemon and restarts it, but does not terminate any existing individual user sessions. Those who feel this might be a risky step are invited to simply reboot the machine. At this point, OpenSSH will no longer accept passwords of any kind, with access granted only for users with pre-established public keys. Enabling SSH Agent Support Up to this point, weve provided a large manner of security of system access, but its still not terribly convenient: we still must type a (hopefully) complex pass phrase each time. This can get tedious when large numbers of systems are involved. Fortunately, the SSH suite provides a wonderful mechanism for unlocking the private key once, and allowing individual ssh connections to piggyback on it without querying for the passphrase every time. Launch the agent Navigate to and launch the pageant. exe program from the same location as the other PuTTY-related files, and it will put itself into the system tray (in the lower right near the clock). Double-click the icon in the tray, and it launches a dialog box with an empty list of keys. Click Add Key and navigate to the. ppk file which contains your private key. When prompted for the passphrase, enter it and click OK. Click Close to dismiss the agent. Now, launch one of the already-configured SSH sessions to a pubkey-secured remote host: it will query the agent for the private key, exchange it with the remote, and grant access without further user intervention. Note - the thoughtful reader may wonder just how the agent stores the data, and whether untrusted programs are able to obtain this secret key surreptitiously. Were not sure how it works, but weve not ever heard of real security concerns on this front. Well update this document if we learn something. Preload the private key The first thing that many PuTTY users do when logging into the system for the day is to launch the agent and add the private key. This is just a few steps, but we can optimize it just a bit more. If we launch the agent with the private key file as a parameter, it loads the key automatically. Navigate to pageant. exe and right-click to copy this icon. Paste this as a shortcut on the desktop, then right-click and select Properties. Enter the full path of the. ppk private key file as the parameter, then save the changes. Double-clicking this icon will load the keyfile, demanding the passphrase. Once entered, thats the last time its needed as long as the agent sticks around. There is very little not to like about SSH agent support. Agent Forwarding But weve not exhausted the benefits of SSH agent support. Its a clear win to avoid typing the passphrase every time a new connection is launched, but SSH also provides Agent Forwarding which can pass the credential down the connection to the remote server. This credential can then be passed to yet another server where the users public key has been installed, obviating passwords or the secret passphrase for the entire duration of a network navigation. User launches a connection to Server A: PuTTY on the local machine gets the private key from the agent and provides it to the remote server. Remote server processes the public and private key data and grants access. The user is given a shell on the local system. User attempts to connect to SystemB with ssh - A systemb ( - A enables agent forwarding), and it connects to the SSH server there. System B asks system A for the users private key data, and the SSH server on system A in turn forwards this back to the original workstation where the agent is queried. The local agent passes the data back up the connection, where its forwarded from SystemA to SystemB. SystemB receives this credential, and access is granted by comparing to the public key stored on that machine for that user. This happens automatically and quickly: it takes no more than a second or two for the entire exchange to occur, and this forwarding can go over quite a long chain of SSH connections. This provides for transparent, secure access to a wide range of remote systems. Note - All of this requires that the user have an account on each machine in question, and that the users public key is installed properly on each one. SSH forwarding doesnt provide any access which would not be granted absent forwarding it just adds a more convenient mechanism to whats already provided. Enable Forwarding in PuTTY Enabling agent forwarding is done in the PuTTY configuration dialogs much like all the rest, and just one additional box need to be checked. This option requires, of course, the use of pageant on the local system - without an agent, theres nothing to forward. Should a key-protected connection be attempted with no agent present, PuTTY will simply prompt for the passphrase as it has all along (and will do so on each connection ). Enable Forwarding on the Server In the example above, we saw that the user typed ssh - A host . but its common to make Use agent forwarding the default setting to remove the need to type the - A. The OpenSSH server configuration is found in sshdconfig . while the client configuration is in sshconfig (typically in the etcssh directory). The file can be edited and the ForwardAgent setting set to yes: This setting doesnt affect the server, so it requires no reboot or special operation for it to take effect: the next outbound connection will enable forwarding automatically. This change need be made only once (and its the default on some systems). Copying files securely With the configuration of PuTTY, public key access, and agent support (with forwarding), were prepared to step beyond terminal shell access and move files around. Secure Shell provides multiple methods for copying files from one machine to another, all working together with the same keys and agents. PSCP allows for command-line copying of files to and from a remote SSH server, and PSFTP provides an FTP-like interface for convenient file transfer. Well discuss both. PSFTP - an FTP-like client The PSFTP program can be launched from the command line or from a desktop shortcut, and in both cases accepts either a hostname or a saved session name. When launched, it connects to the target server (fully taking advantage of public keys and the local agent, if any), and presents a psftpgt prompt: Regular users of command-line FTP clients will find this familiar, though its certainly not up to the ease of use as popular GUI clients. The help command may provide some guidance. PSCP - Secure Copy Users at the command line may wish to copy files directly, and this is done with pscp . the Secure Copy command. Just like copying regular files on the local filesystem, pscp takes a machine name and directory as a source or destination. pscp can transfer one file at a time, or a whole set in a single instance: Curiously, the saved session name need not be provided just the hostname and the current username (which is usually taken automatically from the environment. It appears that psftp and pscp both consult the saved-session list, find an appropriate match, and then use the access information associated. This makes for a smooth file-transfer experience. Security Concerns and the Finer Points This Tech Tip has intended to provide a fast path to setting up a Secure Shell environment from workstation to server, but it has skipped over many of the finer points. The whole point of using Secure Shell is Security, and wed be remiss if we didnt touch on some of these points here. Well make the broader point that one must take care when working on an untrusted system: when using advanced features such as agent forwarding or private keys, one is at the mercy of a hostile operator. Kernel-based keyloggers and Trojaned binssh bi naries are just a few of many obvious risks when operating in that kind of environment. Here well touch on a few of the non-obvious points and note that in a trusted and controlled environment, these issues simply dont arise. Protect your private key Though the public key is of only minor concern, the private key must be protected vigorously. Anyone who can get to the decrypted private key (either by learning the passphrase, or brute-forcing it) has full run of all networks where the public key is installed. We strongly recommend limiting dramatically the number of places where the private key is kept. We presume that applications exist which can take a private-key file and attempt to brute-force the key, though weve not yet run across one. Agent use requires trusted machines Whenever an SSH key agent is present, whether it be on the local machine which initiates the outgoing connection, or on intermediate machines which are forwarding them, its technically possible for interlopers on those machines to get access to the secure channel. In OpenSSH, an ssh client communicates with the agent via a UNIX domain socket under the tmp directory( a representative file is tmpssh-DeB10132agent.10132 ), and its restricted to the local user. But superusers also have access to the socket, and its relatively straightforward to hijack the agent to connect to the same target machine. Related ResourcesOpenSSH is the premier connectivity tool for remote login with the SSH protocol. It encrypts all traffic to eliminate eavesdropping, connection hijacking, and other attacks. In addition, OpenSSH provides a large suite of secure tunneling capabilities, several authentication methods, and sophisticated configuration options. OpenSSH is developed by a few developers of the OpenBSD Project and made available under a BSD-style license. OpenSSH is incorporated into many commercial products, but very few of those companies assist OpenSSH with funding. Contributions towards OpenSSH can be sent to the OpenBSD Foundation. This site Copyright copy 1999-2017 OpenBSD. sshdconfig(5) - Linux man page sshdconfig - OpenSSH SSH daemon configuration file Description sshd (8) reads configuration data from etcsshsshdconfig (or the file specified with - f on the command line). The file contains keyword-argument pairs, one per line. Lines starting with and empty lines are interpreted as comments. Arguments may optionally be enclosed in double quotes () in order to represent arguments containing spaces. The possible keywords and their meanings are as follows (note that keywords are case-insensitive and arguments are case-sensitive): Specifies what environment variables sent by the client will be copied into the sessions environ (7). See SendEnv in sshconfig (5) for how to configure the client. Note that environment passing is only supported for protocol 2. Variables are specified by name, which may contain the wildcard characters and . Multiple environment variables may be separated by whitespace or spread across multiple AcceptEnv directives. Be warned that some environment variables could be used to bypass restricted user environments. For this reason, care should be taken in the use of this directive. The default is not to accept any environment variables. AddressFamily Specifies which address family should be used by sshd (8). Valid arguments are any, inet (use IPv4 only), or inet6 (use IPv6 only). The default is any. AllowAgentForwarding Specifies whether ssh-agent (1) forwarding is permitted. The default is yes. Note that disabling agent forwarding does not improve security unless users are also denied shell access, as they can always install their own forwarders. AllowGroups This keyword can be followed by a list of group name patterns, separated by spaces. If specified, login is allowed only for users whose primary group or supplementary group list matches one of the patterns. Only group names are valid a numerical group ID is not recognized. By default, login is allowed for all groups. The allowdeny directives are processed in the following order: DenyUsers . AllowUsers . DenyGroups . and finally AllowGroups . See PATTERNS in sshconfig (5) for more information on patterns. AllowTcpForwarding Specifies whether TCP forwarding is permitted. The default is yes. Note that disabling TCP forwarding does not improve security unless users are also denied shell access, as they can always install their own forwarders. AllowUsers This keyword can be followed by a list of user name patterns, separated by spaces. If specified, login is allowed only for user names that match one of the patterns. Only user names are valid a numerical user ID is not recognized. By default, login is allowed for all users. If the pattern takes the form USERHOST then USER and HOST are separately checked, restricting logins to particular users from particular hosts. The allowdeny directives are processed in the following order: DenyUsers . AllowUsers . DenyGroups . and finally AllowGroups . See PATTERNS in sshconfig (5) for more information on patterns. AuthorizedKeysFile Specifies the file that contains the public keys that can be used for user authentication. AuthorizedKeysFile may contain tokens of the form T which are substituted during connection setup. The following tokens are defined: is replaced by a literal , h is replaced by the home directory of the user being authenticated, and u is replaced by the username of that user. After expansion, AuthorizedKeysFile is taken to be an absolute path or one relative to the users home directory. The default is. sshauthorizedkeys. Banner The contents of the specified file are sent to the remote user before authentication is allowed. If the argument is none then no banner is displayed. This option is only available for protocol version 2. By default, no banner is displayed. ChallengeResponseAuthentication Specifies whether challenge-response authentication is allowed (e. g. via PAM or though authentication styles supported in login. conf (5)) The default is yes. ChrootDirectory Specifies a path to chroot (2) to after authentication. This path, and all its components, must be root-owned directories that are not writable by any other user or group. After the chroot, sshd (8) changes the working directory to the users home directory. The path may contain the following tokens that are expanded at runtime once the connecting user has been authenticated: is replaced by a literal , h is replaced by the home directory of the user being authenticated, and u is replaced by the username of that user. The ChrootDirectory must contain the necessary files and directories to support the users session. For an interactive session this requires at least a shell, typically sh (1), and basic dev nodes such as null (4), zero (4), stdin (4), stdout (4), stderr (4), arandom (4) and tty (4) devices. For file transfer sessions using sftp, no additional configuration of the environment is necessary if the in-process sftp server is used, though sessions which use logging do require devlog inside the chroot directory (see sftp-server (8) for details). The default is not to chroot (2). Ciphers Specifies the ciphers allowed for protocol version 2. Multiple ciphers must be comma-separated. The supported ciphers are 3des-cbc, aes128-cbc, aes192-cbc, aes256-cbc, aes128-ctr, aes192-ctr, aes256-ctr, arcfour128, arcfour256, arcfour, blowfish-cbc, and cast128-cbc. The default is: aes128-ctr, aes192-ctr, aes256-ctr, arcfour256,arcfour128, aes128-cbc,3des-cbc, blowfish-cbc, cast128-cbc, aes192-cbc, aes256-cbc, arcfour Sets the number of client alive messages (see below) which may be sent without sshd (8) receiving any messages back from the client. If this threshold is reached while client alive messages are being sent, sshd will disconnect the client, terminating the session. It is important to note that the use of client alive messages is very different from TCPKeepAlive (below). The client alive messages are sent through the encrypted channel and therefore will not be spoofable. The TCP keepalive option enabled by TCPKeepAlive is spoofable. The client alive mechanism is valuable when the client or server depend on knowing when a connection has become inactive. The default value is 3. If ClientAliveInterval (see below) is set to 15, and ClientAliveCountMax is left at the default, unresponsive SSH clients will be disconnected after approximately 45 seconds. This option applies to protocol version 2 only. ClientAliveInterval Sets a timeout interval in seconds after which if no data has been received from the client, sshd (8) will send a message through the encrypted channel to request a response from the client. The default is 0, indicating that these messages will not be sent to the client. This option applies to protocol version 2 only. Compression Specifies whether compression is allowed, or delayed until the user has authenticated successfully. The argument must be yes, delayed, or no. The default is delayed. DenyGroups This keyword can be followed by a list of group name patterns, separated by spaces. Login is disallowed for users whose primary group or supplementary group list matches one of the patterns. Only group names are valid a numerical group ID is not recognized. By default, login is allowed for all groups. The allowdeny directives are processed in the following order: DenyUsers . AllowUsers . DenyGroups . and finally AllowGroups . See PATTERNS in sshconfig (5) for more information on patterns. DenyUsers This keyword can be followed by a list of user name patterns, separated by spaces. Login is disallowed for user names that match one of the patterns. Only user names are valid a numerical user ID is not recognized. By default, login is allowed for all users. If the pattern takes the form USERHOST then USER and HOST are separately checked, restricting logins to particular users from particular hosts. The allowdeny directives are processed in the following order: DenyUsers . AllowUsers . DenyGroups . and finally AllowGroups . See PATTERNS in sshconfig (5) for more information on patterns. ForceCommand Forces the execution of the command specified by ForceCommand . ignoring any command supplied by the client and. sshrc if present. The command is invoked by using the users login shell with the - c option. This applies to shell, command, or subsystem execution. It is most useful inside a Match block. The command originally supplied by the client is available in the SSHORIGINALCOMMAND environment variable. Specifying a command of internal-sftp will force the use of an in-process sftp server that requires no support files when used with ChrootDirectory . GatewayPorts Specifies whether remote hosts are allowed to connect to ports forwarded for the client. By default, sshd (8) binds remote port forwardings to the loopback address. This prevents other remote hosts from connecting to forwarded ports. GatewayPorts can be used to specify that sshd should allow remote port forwardings to bind to non-loopback addresses, thus allowing other hosts to connect. The argument may be no to force remote port forwardings to be available to the local host only, yes to force remote port forwardings to bind to the wildcard address, or clientspecified to allow the client to select the address to which the forwarding is bound. The default is no. GSSAPIAuthentication Specifies whether user authentication based on GSSAPI is allowed. The default is no. Note that this option applies to protocol version 2 only. GSSAPIKeyExchange Specifies whether key exchange based on GSSAPI is allowed. GSSAPI key exchange doesnt rely on ssh keys to verify host identity. The default is no. Note that this option applies to protocol version 2 only. GSSAPICleanupCredentials Specifies whether to automatically destroy the users credentials cache on logout. The default is yes. Note that this option applies to protocol version 2 only. GSSAPIStrictAcceptorCheck Determines whether to be strict about the identity of the GSSAPI acceptor a client authenticates against. If yes then the client must authenticate against the host service on the current hostname. If no then the client may authenticate against any service key stored in the machines default store. This facility is provided to assist with operation on multi homed machines. The default is yes. Note that this option applies only to protocol version 2 GSSAPI connections, and setting it to no may only work with recent Kerberos GSSAPI libraries. GSSAPIStoreCredentialsOnRekey Controls whether the users GSSAPI credentials should be updated following a successful connection rekeying. This option can be used to accepted renewed or updated credentials from a compatible client. The default is no. HostbasedAuthentication Specifies whether rhosts or etchosts. equiv authentication together with successful public key client host authentication is allowed (host-based authentication). This option is similar to RhostsRSAAuthentication and applies to protocol version 2 only. The default is no. HostbasedUsesNameFromPacketOnly Specifies whether or not the server will attempt to perform a reverse name lookup when matching the name in the. rhosts . and etchosts. equiv files during HostbasedAuthentication . A setting of yes means that sshd (8) uses the name supplied by the client rather than attempting to resolve the name from the TCP connection itself. The default is no. HostKey Specifies a file containing a private host key used by SSH. The default is etcsshsshhostkey for protocol version 1, and etcsshsshhostrsakey and etcsshsshhostdsakey for protocol version 2. Note that sshd (8) will refuse to use a file if it is groupworld-accessible. It is possible to have multiple host key files. rsa1 keys are used for version 1 and dsa or rsa are used for version 2 of the SSH protocol. IgnoreRhosts Specifies that. rhosts and. shosts files will not be used in RhostsRSAAuthentication or HostbasedAuthentication . etchosts. equiv and etcsshshosts. equiv are still used. The default is yes. IgnoreUserKnownHosts Specifies whether sshd (8) should ignore the users. sshknownhosts during RhostsRSAAuthentication or HostbasedAuthentication . The default is no. KerberosAuthentication Specifies whether the password provided by the user for PasswordAuthentication will be validated through the Kerberos KDC. To use this option, the server needs a Kerberos servtab which allows the verification of the KDCs identity. The default is no. KerberosGetAFSToken If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire an AFS token before accessing the users home directory. The default is no. KerberosOrLocalPasswd If password authentication through Kerberos fails then the password will be validated via any additional local mechanism such as etcpasswd . The default is yes. KerberosTicketCleanup Specifies whether to automatically destroy the users ticket cache file on logout. The default is yes. KerberosUseKuserok Specifies whether to look at. k5login file for users aliases. The default is yes. KeyRegenerationInterval In protocol version 1, the ephemeral server key is automatically regenerated after this many seconds (if it has been used). The purpose of regeneration is to prevent decrypting captured sessions by later breaking into the machine and stealing the keys. The key is never stored anywhere. If the value is 0, the key is never regenerated. The default is 3600 (seconds). ListenAddress Specifies the local addresses sshd (8) should listen on. The following forms may be used: If port is not specified, sshd will listen on the address and all prior Port options specified. The default is to listen on all local addresses. Multiple ListenAddress options are permitted. Additionally, any Port options must precede this option for non-port qualified addresses. LoginGraceTime The server disconnects after this time if the user has not successfully logged in. If the value is 0, there is no time limit. The default is 120 seconds. LogLevel Gives the verbosity level that is used when logging messages from sshd (8). The possible values are: QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3. The default is INFO. DEBUG and DEBUG1 are equivalent. DEBUG2 and DEBUG3 each specify higher levels of debugging output. Logging with a DEBUG level violates the privacy of users and is not recommended. MACs Specifies the available MAC (message authentication code) algorithms. The MAC algorithm is used in protocol version 2 for data integrity protection. Multiple algorithms must be comma-separated. The default is: hmac-md5,hmac-sha1,umac-64openssh , hmac-ripemd160,hmac-sha1-96,hmac-md5-96 Introduces a conditional block. If all of the criteria on the Match line are satisfied, the keywords on the following lines override those set in the global section of the config file, until either another Match line or the end of the file. The arguments to Match are one or more criteria-pattern pairs. The available criteria are User . Group . Host . and Address . The match patterns may consist of single entries or comma-separated lists and may use the wildcard and negation operators described in the PATTERNS section of sshconfig (5). The patterns in an Address criteria may additionally contain addresses to match in CIDR addressmasklen format, e. g. 192.0.2.024 or 3ffe:ffff::32. Note that the mask length provided must be consistent with the address - it is an error to specify a mask length that is too long for the address or one with bits set in this host portion of the address. For example, 192.0.2.033 and 192.0.2.08 respectively. Only a subset of keywords may be used on the lines following a Match keyword. Available keywords are AllowAgentForwarding . AllowTcpForwarding . Banner . ChrootDirectory . ForceCommand . GatewayPorts . GSSAPIAuthentication . HostbasedAuthentication . KbdInteractiveAuthentication . KerberosAuthentication . KerberosUseKuserok . MaxAuthTries . MaxSessions . PubkeyAuthentication . AuthorizedKeysCommand . AuthorizedKeysCommandRunAs . PasswordAuthentication . PermitEmptyPasswords . PermitOpen . PermitRootLogin . RequiredAuthentications1, RequiredAuthentications2, RhostsRSAAuthentication . RSAAuthentication . X11DisplayOffset . X11Forwarding and X11UseLocalHost . MaxAuthTries Specifies the maximum number of authentication attempts permitted per connection. Once the number of failures reaches half this value, additional failures are logged. The default is 6. MaxSessions Specifies the maximum number of open sessions permitted per network connection. The default is 10. MaxStartups Specifies the maximum number of concurrent unauthenticated connections to the SSH daemon. Additional connections will be dropped until authentication succeeds or the LoginGraceTime expires for a connection. The default is 10. Alternatively, random early drop can be enabled by specifying the three colon separated values start:rate:full (e. g. 10:30:60). sshd (8) will refuse connection attempts with a probability of rate100 (30) if there are currently start (10) unauthenticated connections. The probability increases linearly and all connection attempts are refused if the number of unauthenticated connections reaches full (60). PasswordAuthentication Specifies whether password authentication is allowed. The default is yes. PermitEmptyPasswords When password authentication is allowed, it specifies whether the server allows login to accounts with empty password strings. The default is no. PermitOpen Specifies the destinations to which TCP port forwarding is permitted. The forwarding specification must be one of the following forms: Multiple forwards may be specified by separating them with whitespace. An argument of any can be used to remove all restrictions and permit any forwarding requests. By default all port forwarding requests are permitted. PermitRootLogin Specifies whether root can log in using ssh (1). The argument must be yes, without-password, forced-commands-only, or no. The default is yes. If this option is set to without-password, password authentication is disabled for root. If this option is set to forced-commands-only, root login with public key authentication will be allowed, but only if the command option has been specified (which may be useful for taking remote backups even if root login is normally not allowed). All other authentication methods are disabled for root. If this option is set to no, root is not allowed to log in. PermitTunnel Specifies whether tun (4) device forwarding is allowed. The argument must be yes, point-to-point (layer 3), ethernet (layer 2), or no. Specifying yes permits both point-to-point and ethernet. The default is no. PermitUserEnvironment Specifies whether. sshenvironment and environment options in. sshauthorizedkeys are processed by sshd (8). The default is no. Enabling environment processing may enable users to bypass access restrictions in some configurations using mechanisms such as LDPRELOAD. PidFile Specifies the file that contains the process ID of the SSH daemon. The default is varrunsshd. pid . Port Specifies the port number that sshd (8) listens on. The default is 22. Multiple options of this type are permitted. See also ListenAddress . PrintLastLog Specifies whether sshd (8) should print the date and time of the last user login when a user logs in interactively. The default is yes. PrintMotd Specifies whether sshd (8) should print etcmotd when a user logs in interactively. (On some systems it is also printed by the shell, etcprofile . or equivalent.) The default is yes. Protocol Specifies the protocol versions sshd (8) supports. The possible values are 1 and 2. Multiple versions must be comma-separated. The default is 2,1. Note that the order of the protocol list does not indicate preference, because the client selects among multiple protocol versions offered by the server. Specifying 2,1 is identical to 1,2. PubkeyAuthentication Specifies whether public key authentication is allowed. The default is yes. Note that this option applies to protocol version 2 only. AuthorizedKeysCommand Specifies a program to be used for lookup of the users public keys. The program will be invoked with its first argument the name of the user being authorized, and should produce on standard output AuthorizedKeys lines (see AUTHORIZEDKEYS in sshd (8)). By default (or when set to the empty string) there is no AuthorizedKeysCommand run. If the AuthorizedKeysCommand does not successfully authorize the user, authorization falls through to the AuthorizedKeysFile. Note that this option has an effect only with PubkeyAuthentication turned on. AuthorizedKeysCommandRunAs Specifies the user under whose account the AuthorizedKeysCommand is run. Empty string (the default value) means the user being authorized is used. RequiredAuthentications12 Specifies required methods of authentications that has to succeed before authorizing the connection. (RequiredAuthentication1 for Protocol version 1, and RequiredAuthentication2 for v2) RequiredAuthentications1 method, method. RequiredAuthentications2 method, method. Example 1: Example 2: Available methods: Specifies whether rhosts or etchosts. equiv authentication together with successful RSA host authentication is allowed. The default is no. This option applies to protocol version 1 only. RSAAuthentication Specifies whether pure RSA authentication is allowed. The default is yes. This option applies to protocol version 1 only. ServerKeyBits Defines the number of bits in the ephemeral protocol version 1 server key. The minimum value is 512, and the default is 1024. ShowPatchLevel Specifies whether sshd will display the patch level of the binary in the identification string. The patch level is set at compile-time. The default is no. This option applies to protocol version 1 only. StrictModes Specifies whether sshd (8) should check file modes and ownership of the users files and home directory before accepting login. This is normally desirable because novices sometimes accidentally leave their directory or files world-writable. The default is yes. Subsystem Configures an external subsystem (e. g. file transfer daemon). Arguments should be a subsystem name and a command (with optional arguments) to execute upon subsystem request. The command sftp-server (8) implements the sftp file transfer subsystem. Alternately the name internal-sftp implements an in-process sftp server. This may simplify configurations using ChrootDirectory to force a different filesystem root on clients. By default no subsystems are defined. Note that this option applies to protocol version 2 only. SyslogFacility Gives the facility code that is used when logging messages from sshd (8). The possible values are: DAEMON, USER, AUTH, AUTHPRIV, LOCAL0, LOCAL1, LOCAL2, LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7. The default is AUTH. TCPKeepAlive Specifies whether the system should send TCP keepalive messages to the other side. If they are sent, death of the connection or crash of one of the machines will be properly noticed. However, this means that connections will die if the route is down temporarily, and some people find it annoying. On the other hand, if TCP keepalives are not sent, sessions may hang indefinitely on the server, leaving ghost users and consuming server resources. The default is yes (to send TCP keepalive messages), and the server will notice if the network goes down or the client host crashes. This avoids infinitely hanging sessions. To disable TCP keepalive messages, the value should be set to no. UseDNS Specifies whether sshd (8) should look up the remote host name and check that the resolved host name for the remote IP address maps back to the very same IP address. The default is yes. UseLogin Specifies whether login (1) is used for interactive login sessions. The default is no. Note that login (1) is never used for remote command execution. Note also, that if this is enabled, X11Forwarding will be disabled because login (1) does not know how to handle xauth (1) cookies. If UsePrivilegeSeparation is specified, it will be disabled after authentication. UsePAM Enables the Pluggable Authentication Module interface. If set to yes this will enable PAM authentication using ChallengeResponseAuthentication and PasswordAuthentication in addition to PAM account and session module processing for all authentication types. Because PAM challenge-response authentication usually serves an equivalent role to password authentication, you should disable either PasswordAuthentication or ChallengeResponseAuthentication. If UsePAM is enabled, you will not be able to run sshd (8) as a non-root user. The default is no. UsePrivilegeSeparation Specifies whether sshd (8) separates privileges by creating an unprivileged child process to deal with incoming network traffic. After successful authentication, another process will be created that has the privilege of the authenticated user. The goal of privilege separation is to prevent privilege escalation by containing any corruption within the unprivileged processes. The default is yes. X11DisplayOffset Specifies the first display number available for sshd (8)s X11 forwarding. This prevents sshd from interfering with real X11 servers. The default is 10. X11Forwarding Specifies whether X11 forwarding is permitted. The argument must be yes or no. The default is no. When X11 forwarding is enabled, there may be additional exposure to the server and to client displays if the sshd (8) proxy display is configured to listen on the wildcard address (see X11UseLocalhost below), though this is not the default. Additionally, the authentication spoofing and authentication data verification and substitution occur on the client side. The security risk of using X11 forwarding is that the clients X11 display server may be exposed to attack when the SSH client requests forwarding (see the warnings for ForwardX11 in sshconfig (5)). A system administrator may have a stance in which they want to protect clients that may expose themselves to attack by unwittingly requesting X11 forwarding, which can warrant a no setting. Note that disabling X11 forwarding does not prevent users from forwarding X11 traffic, as users can always install their own forwarders. X11 forwarding is automatically disabled if UseLogin is enabled. X11UseLocalhost Specifies whether sshd (8) should bind the X11 forwarding server to the loopback address or to the wildcard address. By default, sshd binds the forwarding server to the loopback address and sets the hostname part of the DISPLAY environment variable to localhost. This prevents remote hosts from connecting to the proxy display. However, some older X11 clients may not function with this configuration. X11UseLocalhost may be set to no to specify that the forwarding server should be bound to the wildcard address. The argument must be yes or no. The default is yes. XAuthLocation Specifies the full pathname of the xauth (1) program. The default is usrbinxauth . Time Formats sshd (8) command-line arguments and configuration file options that specify time may be expressed using a sequence of the form: time qualifier , where time is a positive integer value and qualifier is one of the following: seconds s S seconds m M minutes h H hours d D days w W weeks Each member of the sequence is added together to calculate the total time value. Time format examples: 600 600 seconds (10 minutes) 10m 10 minutes 1h30m 1 hour 30 minutes (90 minutes) Contains configuration data for sshd (8). This file should be writable by root only, but it is recommended (though not necessary) that it be world-readable. OpenSSH is a derivative of the original and free ssh 1.2.12 release by Tatu Ylonen. Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, Theo de Raadt and Dug Song removed many bugs, re-added newer features and created OpenSSH. Markus Friedl contributed the support for SSH protocol versions 1.5 and 2.0. Niels Provos and Markus Friedl contributed support for privilege separation. BSD April 14, 2013 BSD Referenced By
Comments
Post a Comment