top
logo


Самба (SMB) PDF Печать E-mail
Автор: Administrator   
26.10.09 14:32

Поднимаем простенькую самбу.

opensuse 10.2

решение проблемы с доступом с разными логинами http://thin.kiev.ua/index.php?option=com_content&view=article&id=440:smb&catid=39:linux&Itemid=63

Устанавливаем самбу:

yast -i smb

 

/etc/samba/smb.conf

# smb.conf is the main Samba configuration file. You find a full commented
# version at /usr/share/doc/packages/samba/examples/smb.conf.SUSE if the
# samba-doc package is installed.
# Date: 2007-06-29
[global]
workgroup = FAS
printing = cups
printcap name = cups
printcap cache time = 750
cups options = raw
map to guest = Bad User
include = /etc/samba/dhcp.conf
logon path = \\%L\profiles\.msprofile
logon home = \\%L\%U\.9xprofile
logon drive = P:
usershare allow guests = Yes
add machine script = /usr/sbin/useradd -c Machine -d /var/lib/nobody -s /bin/false %m$
domain logons = No
domain master = No
netbios name = fas
passdb backend = smbpasswd
security = user
usershare max shares = 100
############################################################
#kernel oplocks = Yes
#locking = Yes
#ole locking compatibility = No
#oplocks = Yes
#strict locking = No
#share modes = yes
[homes]
comment = Home Directories
valid users = %S, %D%w%S
browseable = No
read only = No
inherit acls = Yes

## Share disabled by YaST
# [profiles]
# comment = Network Profiles Service
# path = %H
# read only = No
# store dos attributes = Yes
# create mask = 0600
# directory mask = 0700

[users]
comment = All users
path = /home
read only = No
inherit acls = Yes
veto files = /aquota.user/groups/shares/

## Share disabled by YaST
# [groups]
# comment = All groups
# path = /home/groups
# read only = No
# inherit acls = Yes

## Share disabled by YaST
# [printers]
# comment = All Printers
# path = /var/tmp
# printable = Yes
# create mask = 0600
# browseable = No

## Share disabled by YaST
# [print$]
# comment = Printer Drivers
# path = /var/lib/samba/drivers
# write list = @ntadmin root
# force group = ntadmin
# create mask = 0664
# directory mask = 0775

## Share disabled by YaST
# [netlogon]

[store]
inherit acls = Yes
path = /home/store/
read only = No
# browseable = yes #Видимость папки
# writable = yes #В нее можно писать
create mask = 0777
force create mode = 0777
directory mask = 0777
force directory mode = 0777
guest ok = Yes
map archive = Yes
locking = Yes
oplocks = Yes
nt acl support = Yes

 

Добавляем пользователя test:

thin:~ # useradd -m test
thin:~ # passwd test

 

После добавления пользователя в систему, можно добавить его в самбу:

thin:~ # smbpasswd -a test

New SMB password: xxxxx
Retype new SMB password: xxxx

 

Проверяем что в автозагрузке:
thin:~ # chkconfig  --list


Добавляем в автозагрузку SMB:
thin:~ # chkconfig smb 345


Стартуем службу и проверяем:
thin:~ # smb start

 

P.S. Я описал самый простенький способ установки и использование самбы. В интернет, масса вариантов установки? для разных дистров. Дело выбора за вами.

источник: http://www.lissyara.su/?id=1275

 

 

Мой конфиг для папки exchange доступной на запись и чтение всем и вся и персональной папки для каждого юзверя:

[global]
log file = /var/log/samba/log.%m
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
socket options = TCP_NODELAY
obey pam restrictions = yes
map to guest = bad user
encrypt passwords = yes
passdb backend = tdbsam
passwd program = smbpasswd
wins support = true
dns proxy = no
server string = server2
default = exchange
unix password sync = yes
remote announce = 192.168.0.0/
workgroup

workgroup = workgroup
os level = 20
create mode = 760
syslog = 0
usershare allow guests = yes
max log size = 1000
directory mode = 760
pam password change = yes



[homes]

revalidate = yes
browseable = no
writeable = yes
user = @users
write list = @users

#запретить загрузку *.avi*.mp3 *.mp4

veto files = /*.avi/*.mp3/*.mp4/
delete veto files = yes



[exchange]

revalidate = no
public = yes
path = /exchange

#запретить загрузку *.avi*.mp3 *.mp4

veto files = /*.avi/*.mp3/*.mp4/
delete veto files = yes

ссылка на статью: http://thin.kiev.ua/index.php?option=com_content&view=article&id=78:smb&catid=39:linux&Itemid=63

{jcomments on}

Последнее обновление 21.11.11 13:47
 
Интересная статья? Поделись ей с другими:

bottom

 

Unreal Commander PfSense по русски Яндекс.Метрика