اضافة مضاد فيروسات للسيرفر samba على توزيعات اوبونتو








السلام عليكم ورحمة الله تعالى وبركاته.سامبا يسمح بمشاركة الملفات مع الأجهزة التي عليها ويندوز.انا استخدم سامبا كجهاز مركزي عليه الملفات والبرامج والنسخ الاحتياطية الخاصة بالاجهزة التي عليها ويندوز. وكون ويندوز لن يخلوا ابدا من الفايروسات، قمت باضافة مضاد فيروسات لسامبا ليحمي الأجهزة التي تعمل على ويندوز. (مضاد الفايروسات لملفات ويندوز وليس للينوكس نفسه، حيث انه لا يحتاج الى مضاد فيروسات)اضافة مضاد الفيروسات ليس بالعملية السهلة ولكنها ايضا ليست بالصعبة. اذا كنت على اوبونتو هاردي (8.04) يمكنك اتباع الخطوات المذكورة هنا ولن تجد مشاكل أو صعوبة ان شاء الله.


 الخطوة الأولى: تركيب الضروريات 


root@server:~# apt-get update


root@server:~# apt-get install build-essential dpkg-dev samba clamav clamav-base clamav-daemon clamav-freshclam libclamav3





الخطوة الثانية: تحميل المصادر


تأكد أن مستودعات المصادر مفعلة في /etc/apt/sources.list


root@server:~# cd /usr/src


root@server:/usr/src# apt-get source samba


root@server:/usr/src# apt-get build-dep samba


root@server:/usr/src# wget -c http://www.openantivirus.org/download/samba-vscan-0.3.6c-beta5.tar.gz





الخطوة الثالثة: بناء المصادر





root@server:/usr/src# cd samba-3.0.28a/source


root@server:/usr/src/samba-3.0.28a/source# ./configure


root@server:/usr/src/samba-3.0.28a/source# make proto


root@server:/usr/src/samba-3.0.28a/source# cd


root@server:/usr/src/samba-3.0.28a/source# tar zxvf samba-vscan-0.3.6c-beta5.tar.gz


root@server:/usr/src/samba-3.0.28a/source# cd samba-vscan-0.3.6c-beta5


root@server:/usr/src/samba-vscan-0.3.6c-beta5# ./configure --with-samba-source=/usr/src/samba-3.0.28a/source


root@server:/usr/src/samba-vscan-0.3.6c-beta5# make clamav


root@server:/usr/src/samba-vscan-0.3.6c-beta5# chmod 644 vscan-clamav.so


root@server:/usr/src/samba-vscan-0.3.6c-beta5# cp vscan-clamav.so /usr/lib/samba/vfs/


ملاحظة: لم اقم بتركيب سامبا من المصدر، بل النسخة المركبة هي نفسها التي حملتها عبر apt-get، ولكن المصدر ضروري لبناء vscan-clamav فبدون مصدر سامبا لن اتمكن من بنائه.


الخطوة الرابعة: ملفات الاعداد 


انتهينا الان من تركيب مضاد الفيروسات الخاص بـ samba، بقي الان اعداد سامبا (بالاصح، اعداد المجلدات المشاركة) لاستخدامه.


root@server:/usr/src# cd /etc/samba


root@server:/etc/samba# touch vscan-samba.conf


root@server:/etc/samba# nano vscan-samba.conf


ضع فيه:


[samba-vscan]


; run-time configuration for vscan-samba using


; clamd


; all options are set to default values


; do not scan files larger than X bytes. If set to 0 (default),


; this feature is disable (i.e. all files are scanned)


max file size = 0


; log all file access (yes/no). If set to yes, every access will


; be logged. If set to no (default), only access to infected files


; will be logged


verbose file logging = no


; if set to yes (default), a file will be scanned while opening


scan on open = yes


; if set to yes, a file will be scanned while closing (default is yes)


scan on close = yes


; if communication to clamd fails, should access to file denied?


; (default: yes)


deny access on error = yes


; if daemon fails with a minor error (corruption, etc.),


; should access to file denied?


; (default: yes)


deny access on minor error = yes


; send a warning message via Windows Messenger service


; when virus is found?


; (default: yes)


send warning message = yes


; what to do with an infected file


; quarantine: try to move to quantine directory; delete it if moving fails


; delete: delete infected file


; nothing: do nothing


infected file action = delete


; where to put infected files – you really want to change this!


; it has to be on the same physical device as the share!


quarantine directory = /tmp


; prefix for files in quarantine


quarantine prefix = vir-


; as Windows tries to open a file multiple time in a (very) short time


; of period, samba-vscan use a last recently used file mechanism to avoid


; multiple scans of a file. This setting specified the maximum number of


; elements of the last recently used file list. (default: 100)


max lru files entries = 100


; an entry is invalidated after lru file entry lifetime (in seconds).


; (Default: 5)


lru file entry lifetime = 5


; socket name of clamd (default: /var/run/clamd)


clamd socket name = /var/run/clamav/clamd.ctl


; port number the ScannerDaemon listens on


oav port = 8127


الان ضع هاذين السطرين تحت المجلد المشارك الذي تريد تفعيل مضاد الفايروسات فيه (على سبيل المثال، لدي مجلد اسمه aps والجميع يستطيع الكتابة عليه، لذا من الضروري وجود مضاد الفايروسات فيه)


[aps]


path = /shares/aps


comment = APS Shares


writable = yes


guest ok = yes


public = yes


create mask = 0777


vfs object = vscan-clamav


vscan-clamav: config-file = /etc/samba/vscan-samba.conf


الان أعد تشغيل samba


root@server:~# /etc/init.d/samba restart


للتأكد أن مضاد الفايروسات يعمل، قم بتحميل الفايروس eicar التجريبي وحاول نسخه الى المجلد المشارك، ستجد انه لن يتم نسخه.


وللتأكد أن مضاد الفايروسات قام بحذفه فعلا:


root@server:~# cat /var/log/clamav/clamav.log


Tue Sep 23 18:53:55 2015 /shares/aps/eicar.com Eicar-Test-Signature FOUND


اضافة مضاد فيروسات للسيرفر samba على توزيعات اوبونتو 4.5 5 Unknown الاثنين، 26 يناير 2015 السلام عليكم ورحمة الله تعالى وبركاته.سامبا يسمح بمشاركة الملفات مع الأجهزة التي عليها ويندوز. انا استخدم سامبا كجهاز مركزي عليه الملفات وال...


On : الاثنين، 26 يناير 2015,

If you enjoyed this article, sign up for free updates.

author picture

About Author

I'am Unknown, a part-time blogger and template designer from Indonesia who is the founder And Author of تحميل جميع البرامج. I love create Blogger Themes, write about blog design, And Blogspot tweaks. You can subscribe me on G+ @ Unknown .

ليست هناك تعليقات

إرسال تعليق