Linux за българи: Форуми

Linux секция за начинаещи => Настройка на програми => Темата е започната от: supportpc в Aug 27, 2014, 16:08



Титла: Здравейте имам проблем с samba server
Публикувано от: supportpc в Aug 27, 2014, 16:08
Здравейте на всички колеги имам едно питане за самба. В офиса с 15 компютъра всеки от тях си има папка на самбата
искам на 5 от компютрите да не им се виждат папките на самбата от останалите 10 компютъра обаче тези 5 компютър трябва да виждат всички папки на самбата благодаря предварително.


Титла: Re: Здравейте имам проблем с samba server
Публикувано от: go_fire в Aug 27, 2014, 17:04
Хе-хе шефовете да виждат всичко, а служителите нищо. Смени си работата  ;D


п.п. А да и си уточнил заглавието на темата, та никой не е видял.


Титла: Re: Здравейте имам проблем с samba server
Публикувано от: Acho в Aug 27, 2014, 18:07
А може и да пуснеш конфига на самбата ти.


Титла: Re: Здравейте имам проблем с samba server
Публикувано от: korea60 в Aug 27, 2014, 18:46
Примемаме, че имаме нещо подобно:
test1, test2, admin

В конфига на самбата търсиш и слагаш това:
security = user

конфига на папките е подобен на:

[admin]
comment = Admin share
path = /home/admin
read only = no
valid users = admin
writable = yes
browseable = yes

[test1]
comment test1
path = /home/test1
read only = no
browseable = yes
valid users = test1 test2 admin
admin users = admin
writable = yes

[test2]
comment = test2
path = /home/test2
browseable = yes
read only = no
valid users = test1 test2 admin
admin users = admin
writeable = yes


Да не забравяме и:
smbpasswd -a test1 (test2, admin) - eедно след друго

Може и с групи, но итова действа, за 15 човека не виждам смисал от повече, е някои може и да ме обори.


Титла: Re: Здравейте имам проблем с samba server
Публикувано от: supportpc в Sep 01, 2014, 15:30
Здравей Ачо тази седмица ще пусна конфигурацията  :)


Титла: Re: Здравейте имам проблем с samba server
Публикувано от: supportpc в Sep 02, 2014, 10:32
#
# Sample configuration file for the Samba suite for Debian GNU/Linux.
#
#
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options most of which
# are not shown in this example
#
# Some options that are often worth tuning have been included as
# commented-out examples in this file.
#  - When such options are commented with ";", the proposed setting
#    differs from the default Samba behaviour
#  - When commented with "#", the proposed setting is the default
#    behaviour of Samba but the option is considered important
#    enough to be mentioned here
#
# NOTE: Whenever you modify this file you should run the command
# "testparm" to check that you have not made any basic syntactic
# errors.
# A well-established practice is to name the original file
# "smb.conf.master" and create the "real" config file with
# testparm -s smb.conf.master >smb.conf
# This minimizes the size of the really used smb.conf file
# which, according to the Samba Team, impacts performance
# However, use this with caution if your smb.conf file contains nested
# "include" statements. See Debian bug #483187 for a case
# where using a master file is not a good idea.
#

#======================= Global Settings =======================


       






[Marin]
   writeable = yes
   path = /home/Marin
   force directory mode = 777
   force create mode = 777
   public = yes
   create mode = 777
   directory mode = 777

[Lili]
   writeable = yes
   path = /home/Lili
   force directory mode = 777
   force create mode = 777
   public = yes
   create mode = 777
   directory mode = 777

[Jeni]
   writeable = yes
   path = /home/Jeni
   force directory mode = 777
   force create mode = 777
   public = yes
   create mode = 777
   directory mode = 777


[Svetla]
   writeable = yes
   path = /home/Svetla
   force directory mode = 777
   force create mode = 777
   public = yes
   create mode = 777
   directory mode = 777
   
[Pesho]
   writeable = yes
   path = /home/Pesho
   force directory mode = 777
   force create mode = 777
   public = yes
   create mode = 777
   directory mode = 777
   
[New-2]
   writeable = yes
   path = /home/New-2
   force directory mode = 777
   force create mode = 777
   public = yes
   create mode = 777
   directory mode = 777
   
[New-1]
   writeable = yes
   path = /home/New-1
   force directory mode = 777
   force create mode = 777
   public = yes
   create mode = 777
   directory mode = 777
   
[Mariana]
   writeable = yes
   path = /home/Mariana
   force directory mode = 777
   force create mode = 777
   public = yes
   create mode = 777
   directory mode = 777
   
[Stasi]
   writeable = yes
   path = /home/Stasi
   force directory mode = 777
   force create mode = 777
   public = yes
   create mode = 777
   directory mode = 777
   
[Mimi]
   writeable = yes
   path = /home/Mimi
   force directory mode = 777
   force create mode = 777
   public = yes
   create mode = 777
   directory mode = 777
[New-4]
   writeable = yes
   path = /home/New-4
   force directory mode = 777
   force create mode = 777
   public = yes
   create mode = 777
   directory mode = 777

[New-3]
   writeable = yes
   path = /home/New-3
   force directory mode = 777
   force create mode = 777
   public = yes
   create mode = 777
   directory mode = 777


това е конфигурацията на самбата


Титла: Re: Здравейте имам проблем с samba server
Публикувано от: Acho в Sep 02, 2014, 15:05
А къде е общата част ? Това са само директориите Иван, Драган, Пенчо, Мими и т.н. Другото на подразбиране ли се кара ?


Титла: Re: Здравейте имам проблем с samba server
Публикувано от: supportpc в Sep 02, 2014, 15:25
да на подразбиране нямам глобална конфигурация


Титла: Re: Здравейте имам проблем с samba server
Публикувано от: supportpc в Sep 02, 2014, 15:26
в момента така работи всеки си слага в дадената папка


Титла: Re: Здравейте имам проблем с samba server
Публикувано от: Acho в Sep 02, 2014, 15:32
Говоря за тази секция:

[global]
        unix charset = CP1251
        workgroup = NESHTO_SI
        netbios name = SMB_SERVER
        server string = SMB_SERVER
        interfaces = eth1, 192.168.2.1/27
        bind interfaces only = Yes
        security = SHARE
        log file = /var/log/samba.log.%m
        max log size = 1024
        read bmpx = No
        load printers = No
        disable spoolss = Yes
        show add printer wizard = No
        os level = 51
        preferred master = No
        local master = No
        domain master = No
        ldap ssl = no
        winbind enum users = No
        winbind enum groups = No
        create mask = 0644
        hide special files = No

Виж прочети за директивата security = SHARE. При мене е старата samba, при теб вероятно е по-нова версия.


Титла: Re: Здравейте имам проблем с samba server
Публикувано от: supportpc в Sep 02, 2014, 15:41
#
# Sample configuration file for the Samba suite for Debian GNU/Linux.
#
#
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options most of which
# are not shown in this example
#
# Some options that are often worth tuning have been included as
# commented-out examples in this file.
#  - When such options are commented with ";", the proposed setting
#    differs from the default Samba behaviour
#  - When commented with "#", the proposed setting is the default
#    behaviour of Samba but the option is considered important
#    enough to be mentioned here
#
# NOTE: Whenever you modify this file you should run the command
# "testparm" to check that you have not made any basic syntactic
# errors.
# A well-established practice is to name the original file
# "smb.conf.master" and create the "real" config file with
# testparm -s smb.conf.master >smb.conf
# This minimizes the size of the really used smb.conf file
# which, according to the Samba Team, impacts performance
# However, use this with caution if your smb.conf file contains nested
# "include" statements. See Debian bug #483187 for a case
# where using a master file is not a good idea.
#

#======================= Global Settings =======================
[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* .
   obey pam restrictions = yes
   map to guest = bad user
   encrypt passwords = true
   passwd program = /usr/bin/passwd %u
   passdb backend = tdbsam
   dns proxy = no
   server string = %h server (Samba, Ubuntu)
   path = /home
   unix password sync = yes
   workgroup = WORKGROUP
   syslog = 0
   usershare allow guests = yes
   panic action = /usr/share/samba/panic-action %d
   max log size = 1000
   pam password change = no
        vfs object = recycle
        recycle:repository = Recycle_Bin
        recycle:keeptree = yes
        recycle:exclude = *.tmp, *~, *.bak
        security = user






[Marin]
   writeable = yes
   path = /home/Marin
   force directory mode = 777
   force create mode = 777
   public = yes
   create mode = 777
   directory mode = 777
        read only = no

[Lili]
   writeable = yes
   path = /home/Lili
   force directory mode = 777
   force create mode = 777
   public = yes
   create mode = 777
   directory mode = 777
        read only = no

[Jeni]
   writeable = yes
   path = /home/Jeni
   force directory mode = 777
   force create mode = 777
   public = yes
   create mode = 777
   directory mode = 777
        read only = no


[Svetla]
   writeable = yes
   path = /home/Svetla
   force directory mode = 777
   force create mode = 777
   public = yes
   create mode = 777
   directory mode = 777
        read only = no
   
[Pesho]
   writeable = yes
   path = /home/Pesho
   force directory mode = 777
   force create mode = 777
   public = yes
   create mode = 777
   directory mode = 777
        read only = no
   
[New-2]
   writeable = yes
   path = /home/New-2
   force directory mode = 777
   force create mode = 777
   public = yes
   create mode = 777
   directory mode = 777
   

[Mariana]
   writeable = yes
   path = /home/Mariana
   force directory mode = 777
   force create mode = 777
   public = yes
   create mode = 777
   directory mode = 777
        read only = no
   
[Stasi]
   writeable = yes
   path = /home/Stasi
   force directory mode = 777
   force create mode = 777
   public = yes
   create mode = 777
   directory mode = 777
        read only = no
   
[Mimi]
   writeable = yes
   path = /home/Mimi
   force directory mode = 777
   force create mode = 777
   public = yes
   create mode = 777
   directory mode = 777
        read only = no
[New-4]
   writeable = yes
   path = /home/New-4
   force directory mode = 777
   force create mode = 777
   public = yes
   create mode = 777
   directory mode = 777
        read only = no
       

[New-3]
   writeable = yes
   path = /home/New-3
   force directory mode = 777
   force create mode = 777
   public = yes
   create mode = 777
   directory mode = 777
        read only = no
       


Титла: Re: Здравейте имам проблем с samba server
Публикувано от: supportpc в Sep 02, 2014, 18:34
Това е цялата конфигурация имам създадените юзъри jeni marin s password и като вляза ми дава грешка на windows не ги достъпвам къде бъркам
[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* .
   obey pam restrictions = yes
   map to guest = bad user
   encrypt passwords = true
   passwd program = /usr/bin/passwd %u
   passdb backend = tdbsam
   dns proxy = no
   server string = %h server (Samba, Ubuntu)
   path = /home
   unix password sync = yes
   workgroup = WORKGROUP
   syslog = 0
   usershare allow guests = yes
   panic action = /usr/share/samba/panic-action %d
   max log size = 1000
   pam password change = no
        vfs object = recycle
        recycle:repository = Recycle_Bin
        recycle:keeptree = yes
        recycle:exclude = *.tmp, *~, *.bak
        read only = no
        force directory mode = 777
   force create mode = 777
        create mode = 777
   directory mode = 777
   

[Marin]
   guest account = marin
   writeable = yes
   read list = marin,@users
   valid users = marin,@users
   user = marin,@users
   path = /home/Marin
   write list = marin,@users

[Lili]
   writeable = yes
   path = /home/Lili
   public = yes
   
       

[Jeni]
   writeable = yes
   read list = jeni,@users
   write list = jeni,@users
   path = /home/Jeni
   valid users = jeni,@users
   user = jeni,@users



[Svetla]
   writeable = yes
   path = /home/Svetla
   public = yes
   
       
   
[Pesho]
   writeable = yes
   path = /home/Pesho
   public = yes
   
   
   
[New-2]
   writeable = yes
   path = /home/New-2
   public = yes
   
   

[Mariana]
   writeable = yes
   path = /home/Mariana
   public = yes
   
   
     
   
[Stasi]
   writeable = yes
   path = /home/Stasi
   public = yes
   
       
   
[Mimi]
   writeable = yes
   path = /home/Mimi
   public = yes
   
       
[New-4]
   writeable = yes
   path = /home/New-4
   public = yes
   
       
       

[New-3]
   writeable = yes
   path = /home/New-3   
   public = yes
   
       
       
[New-1]
   writeable = yes
   path = /home/New-1
   public = yes


Титла: Re: Здравейте имам проблем с samba server
Публикувано от: mavar в Sep 04, 2014, 00:31
Според мен трябва просто да промениш маската на тези които не трябва да се виждат от другите да не е 777, а например 770.


Титла: Re: Здравейте имам проблем с samba server
Публикувано от: vladimirovbg в Sep 04, 2014, 12:27
Просто направи 2 групи - на едната група дай достъп до всички файлове и папки, а на другата само на нужните. Ако се налага режи по група, ако се налага режи по "всички останали".


Титла: Re: Здравейте имам проблем с samba server
Публикувано от: supportpc в Sep 05, 2014, 17:04
Как става това с групите да кажа кой папки да се виждад в дадена група


Титла: Re: Здравейте имам проблем с samba server
Публикувано от: vladimirovbg в Sep 05, 2014, 18:13
Сега като гледам ти имаш доста по елемнтарно решение (при мен конфига на самбата е за над 140 човека и е доста усложнено).
Ето какво да направиш при твоето положение с малкото потребители:

добави директивите valid users и invalid users за всяка папка, например:

valid users = gosho, tosho, ilian
invalid user = penka, vanya

инак групи към ресурсите се добавят с @ пред името на групата, например имаш група @users
valid users = penka, @users, slavka

Ако искаш да добавяш потребители и групи за писане, добавяш ги в директивата:
write list=gosho, tosho, maya

Ако искаш да добавяш потребители и групи за четене, добавяш ги в директивата:
read list=az, ti, tq

Виж тук, има доста инфо: https://www.samba.org/samba/docs/using_samba/ch09.html