smbd
and nmbd
.
dpkg-reconfigure samba-common samba
.
FALCOTNET
). يسأل سؤال ثانٍ عن رغبتك بتشفير كلمات السر. سيكون الرد بالإيجاب، لأن التشفير إلزامي مع عملاء ويندوز الأحدث؛ بالإضافة إلى أنه يزيد الأمن. لكن في المقابل سيفرض هذا إدارة كلمات سر سامبا بشكل مستقل عن كلمات سر يونكس.
inetd
أو كخدمات مستقلة. استخدام inetd
مفيدٌ فقط عندما لا يستخدم سامبا إلا نادراً؛ لذلك اختار مديرو النظم في فلكوت خيار الخدمات المستقلة.
/etc/samba/smb.conf
. تلخص المقتطفات التالية التعديلات التي أجروها في قسم [global]
.
[global] ## Browsing/Identification ### # Change this to the workgroup/NT-domain name your Samba server will part of workgroup = FALCOTNET # server string is the equivalent of the NT Description field server string = %h server (Samba %v) # Windows Internet Name Serving Support Section: # WINS Support - Tells the NMBD component of Samba to enable its WINS Server wins support = yes[...] ####### Authentication ####### # "security = user" is always a good idea. This will require a Unix account # in this server for every user accessing the server. See # /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/ServerType.html # in the samba-doc package for details. security = user
# You may wish to use password encryption. See the section on # 'encrypt passwords' in the smb.conf(5) manpage before enabling. encrypt passwords = true # If you are using encrypted passwords, Samba will need to know what # password database type you are using. passdb backend = tdbsam [...] ########## Printing ########## # If you want to automatically load your printer list rather # than setting them up individually then you'll need this load printers = yes
# lpr(ng) printing. You may wish to override the location of the # printcap file ; printing = bsd ; printcap name = /etc/printcap # CUPS printing. See also the cupsaddsmb(8) manpage in the # cups-client package. printing = cups
printcap name = cups
يشير إلى ضرورة استخدام سامبا كمخدم أسماء Netbios (WINS) للشبكة المحلية.
| |
هذه هي القيمة الافتراضية لهذا المتغير؛ لكن بما أنها مركزية في إعدادات سامبا، فيفضّل إعادة ضبطها صراحة. كل مستخدم يحتاج المصادقة قبل أن يصل لأي مشاركة.
| |
يطلب من سامبا مشاركة جميع الطابعات المحلية الموجودة في إعدادات CUPS تلقائياً. لا يزال تقييد الوصول لهذه الطابعات ممكناً، بإضافة أقسام مناسبة.
| |
يحدد نوع نظام الطباعة المستخدم؛ وهو CUPS في حالتنا.
|
adduser
مثلاً).
smbpasswd -a user
؛ سيطلب هذا الأمر إدخال كلمة السر.
smbpasswd -x user
. كما يمكن تعطيل حسابات سامبا مؤقتاً (باستخدام smbpasswd -d user
) وإعادة تفعيلها لاحقاً (باستخدام smbpasswd -e user
).
[global]
في ملف الإعداد:
domain logons = yespreferred master = yes logon path = \\%L\profiles\%U
logon script = scripts/logon.bat
يُفعّل وظيفة متحكم النطاق.
| |
يحدد موقع مجلدات بيوت المستخدمين. تُخزّن هذه المجلدات على مشاركة خاصة بها، تسمح بتفعيل خيارات معينة (خصوصاً profile acls المطلوب للتوافق مع ويندوز 2000، و XP و Vista).
| |
يحدد الملف الدفعي (غير التفاعلي، batch) الذي سيستدعى على جهاز ويندوز العميل كلما فتحت جلسة عمل جديدة. كان الملف في هذه الحالة /var/lib/samba/netlogon/scripts/logon.bat . يجب كتابة السكربت بصيغة DOS، حيث تُفصل السطور عن بعضها بمحرف carriage-return ومحرف line-feed؛ إذا أنشأت الملف على لينكس، فاستخدم unix2dos لتحويله.
أكثر الأوامر استخداماً في هذه السكربتات إنشاء السواقات الشبكية آلياً ومزامنة ساعة النظام.
|
[netlogon] comment = Network Logon Service path = /var/lib/samba/netlogon guest ok = yes writable = no share modes = no [profiles] comment = Profile Share path = /var/lib/samba/profiles read only = No profile acls = Yes
/var/lib/samba/profiles/user
)، ويجب أن يملك كل مستخدم المجلد الموافق له.
smbclient
عن مخدمات SMB. وهو يقبل الخيار -U user
، للاتصال بالمخدم بالهوية المحددة. يتصل الأمر smbclient //server/share
بالمشاركة بطريقة تفاعلية تشابه استخدام عميل FTP نصي. يسرد smbclient -L server
جميع المشاركات المتاحة (والمرئية) على المخدم.
mount
بربط مشاركة ويندوز مع شجرة نظام ملفات لينكس (بمساعدة الأمر mount.cifs
المتوفر في cifs-utils).
مثال 11.28. ربط مشاركات ويندوز
mount -t cifs //arrakis/shared /shared \ -o credentials=/etc/smb-credentials
/etc/smb-credentials
(الذي يجب ألا تعطى صلاحية قراءته للمستخدمين) كالتالي:
username = user password = password
uid
وgid
اللذان يسمحان بفرض مالك ومجموعة للملفات المتاحة على المشاركة، حتى لا تنحصر صلاحيات الوصول بالمستخدم الجذر.
/etc/fstab
:
//server/shared /shared cifs credentials=/etc/smb-credentials
umount
القياسي.
http://localhost:631/admin
smb://user:password@server/printer
.