В школе настраиваю файл-сервер на KDesktop 6.0.1 Beta.
Впервые пробую самбу, читал много чего, но понимаю, что где-то недоглядел. Опишу ситуацию подробно.
Задача: сделать 4 расшаренных каталога с разграничением прав доступа (один - с доступом для всех) . 4 пользователя:
admin32, direktor, mo, teacher. Надо, чтобы пользователь
teacher мог заходить с паролем в каталог
/teach1 (но не имел доступа к другим, кроме шары),
mo - в
/mo1 и
/teacher, и
direktor с
admin32 - во все каталоги.
В сети роутер раздаёт ip по dhcp. 20 компов с виндой (WinXP и Win7) и 20 - на линуксах (Mint 11 и PSPO 5.0.4 XFCE).
Сервер Pentuim E5400 (3 GHz)/ 4 Gb / 500 Gb/ встроенная сетевая карта
Устр-во Загр Начало Конец Блоки Id Система
/dev/sda1 2048 8022015 4009984 82 Linux своп / Solaris
/dev/sda2 * 8022016 31459327 11718656 83 Linux
/dev/sda3 31461374 976771071 472654849 5 Расширенный
/dev/sda5 31461376 820520959 394529792 83 Linux ****/var***
/dev/sda6 820523008 976771071 78124032 83 Linux ***/home***
Читал, что на сервере расшаренные папки лучше делать не в /home, а в /var, поэтому так и сделал, создав расшариваемые каталоги в
/var/lib/samba/usershares
#======================= Global Settings =====================================
[global]
# ----------------------- User Shares Options -------------------------
usershare path = /var/lib/samba/usershares
usershare max shares = 100
usershare allow guests = yes
; usershare owner only = no
# ----------------------- Netwrok Related Options -------------------------
workgroup = 32
server string = Samba Server 32
; netbios name = MYSERVER
; interfaces = lo eth0 192.168.12.2/24 192.168.13.2/24
; hosts allow = 127. 192.168.12. 192.168.13.
# --------------------------- Logging Options -----------------------------
# logs split per machine
log file = /var/log/samba/log.%m
# max 50KB per log file, then rotate
max log size = 50
# ----------------------- Standalone Server Options ------------------------
security = user
; passdb backend = tdbsam
# ----------------------- Domain Members Options ------------------------
; realm = MY_REALM
; password server = <NT-Server-Name>
# ----------------------- Domain Controller Options ------------------------
domain master = no
domain logons = no
# the login script name depends on the machine name
; logon script = %m.bat
# the login script name depends on the unix user used
; logon script = %u.bat
; logon path = \\%L\Profiles\%u
# disables profiles support by specifing an empty path
; logon path =
; add user script = /usr/sbin/useradd "%u" -n -g users
; add group script = /usr/sbin/groupadd "%g"
; add machine script = /usr/sbin/useradd -n -c "Workstation (%u)" -M -d /nohome -s /bin/false "%u"
; delete user script = /usr/sbin/userdel "%u"
; delete user from group script = /usr/sbin/userdel "%u" "%g"
; delete group script = /usr/sbin/groupdel "%g"
# ----------------------- Browser Control Options ----------------------------
; local master = no
os level = 65
; preferred master = yes
#----------------------------- Name Resolution -------------------------------
; wins support = yes
; wins server = w.x.y.z
; wins proxy = yes
; dns proxy = yes
# --------------------------- Printing Options -----------------------------
; load printers = yes
cups options = raw
; printcap name = /etc/printcap
#obtain list of printers automatically on SystemV
; printcap name = lpstat
; printing = cups
# --------------------------- Filesystem Options ---------------------------
; map archive = no
; map hidden = no
; map read only = no
; map system = no
; encrypt passwords = yes
guest ok = yes
; guest account = nobody
; store dos attributes = yes
#============================ Share Definitions ==============================
[homes]
comment = Home Directories
browseable = no
writable = yes
; valid users = %S
; valid users = MYDOMAIN\%S
[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
; guest ok = no
; writable = no
printable = yes
# Un-comment the following and create the netlogon directory for Domain Logons
; [netlogon]
; comment = Network Logon Service
; path = /var/lib/samba/netlogon
; guest ok = yes
; writable = no
; share modes = no
# Un-comment the following to provide a specific roving profile share
# the default is to use the user's home directory
; [Profiles]
; path = /var/lib/samba/profiles
; browseable = no
; guest ok = yes
# A publicly accessible directory, but read only, except for people in
# the "staff" group
; [public]
; comment = Public Stuff
; path = /home/samba
; public = yes
; writable = yes
; printable = no
; write list = +staff
[shara]
comment = Общая
path = /shara
public = yes
writable = yes
read only = no
browseable = yes
guest ok = yes
[dir1]
comment = Администрация
path = /dir1
read only = no
browseable = yes
valid users = admin32, direktor
[mo1]
comment = МО
path = /mo1
read only = no
browseable = yes
valid users = admin32, direktor, mo
[teach1]
comment = Учителя
path = /teach1
read only = no
browseable = yes
valid users = admin32, direktor, mo, teacher
На сервере завёл 4 учётки соответственно с именами admin32, direktor, mo, teacher.
Однако первоначально самбу настраивал с помощью утилиты system-config-samba. Там же добавлял пользователей самбы и каталоги.
Имена и пароли пользователей системы и самбы совпадают
Но вот что записано в smbusers
[root@server32 samba]# cat /etc/samba/smbusers
# Unix_name = SMB_name1 SMB_name2 ...
root = administrator admin
nobody = guest pcguest smbguest
Т.е. я не вижу добавленных пользователей :(
В сети вижу каталоги /dir1, /mo1, /teach1 и /shara, но при попытке входа ввожу имя пользователя и правильный пароль и получаю сообщение: "Файл или папка smb://direktor@server32/dir1 не существует".
После чего в списке расшаренных ресурсов вижу домашний каталог пользователя, под которым пытался войти, в данном случае: /direktor.
В данном варианте настройки даже не могу зайти в /shara (такая же ошибка.
Чуть ранее менял настройки (точно не вспомню, что именно, возможно, ставил security = share (не уверен), и в /shara заходил, но не мог создавать файлы/каталоги.
[root@server32 samba]# ls -l /var/lib/samba/usershares
итого 16
drwxr-xr-x 2 root root 4096 Мар 8 16:16 dir1
drwxr-xr-x 2 root root 4096 Мар 8 16:16 mo1
drwxrwxrwx 2 root root 4096 Мар 8 16:13 shara
drwxr-xr-x 3 root root 4096 Мар 9 13:54 teach1
Пробовал менять владельца каталогов на соответствующих пользователей, но не помогло.
Итак, для себя вижу несколько не понятых мной моментов:
1) Пустота в файле /etc/samba/smbusers.
2) Читал, но не понял, что делать с /etc/samba/smbpasswd ?
3) Какие параметры выставлять расшариваемым каталогам через chown ?
Очень прошу помощи, время поджимает, самостоятельно не смог разобраться!