Форум русскоязычного сообщества Ubuntu


Получить помощь и пообщаться с другими пользователями Ubuntu можно
на irc канале #ubuntu-ru в сети Freenode
и в Jabber конференции ubuntu@conference.jabber.ru

Автор Тема: Настройка доступа к папкам [Samba]  (Прочитано 3718 раз)

0 Пользователей и 1 Гость просматривают эту тему.

Оффлайн henry_viner

  • Автор темы
  • Новичок
  • *
  • Сообщений: 1
    • Просмотр профиля
Настройка доступа к папкам [Samba]
« : 05 Марта 2014, 11:59:41 »
Доброго времени суток.

Я настраивал файловый сервер в домене на основе статей https://help.ubuntu.ru/wiki/файловый_сервер_для_windows и https://help.ubuntu.ru/wiki/ввод_в_домен_windows. Расшаренные папки поместил в раздел с файловой системой xfs, так что задать параметр user_xattr в /etc/fstab я не смог.

Дошел до момента раздачи прав на расшаренные папки. Здесь, согласно вышеуказанной статье, задал права доступа
chmod ug+rwx /var/data/profiles
и затем задал владельца
chown root:"пользователи домена" /var/data/profiles.

Далее в настройках smb.conf назначил admin users - доменную группу, в которой состою я сам, read users - доменная группа с учетной записью тестового пользователя. Задал create mask 0600 и directory mask 0700. Здесь, насколько я понимаю, права на папку даются только для администратора папки, т.е. тот, кто указан в admin users. Те же, кто указан в read users должны получить права только на чтение.

Однако все, кто и так состоит в группе "пользователи домена", имеют полные права на папку, заданные конфиги параметров доступа в smb.conf вроде как не работают. Так вот, как же тогда нужно правильно настраивать права на папку на уровне самой системы и в samba?

Оффлайн aport

  • Новичок
  • *
  • Сообщений: 19
    • Просмотр профиля
Re: Настройка доступа к папкам [Samba]
« Ответ #1 : 22 Марта 2014, 00:25:21 »

Controlling Access to Shares

Often you will need to restrict the users who can access a specific share for security reasons. This is very easy to do with Samba because it contains a wealth of options for creating practically any security configuration. Let's introduce a few configurations that you might want to use in your own Samba setup.

We've seen what happens when you specify valid users. However, you are also allowed to specify a list of invalid users—users who should never be allowed access to Samba or its shares. This is done with the invalid users option. We hinted at one frequent use of this option earlier: a global default with the [homes] section to ensure that various system users and superusers cannot be forged for access. For example:

[global]
    invalid users = root bin daemon adm sync shutdown \
                        halt mail news uucp operator
    auto services = dave peter bob

[homes]
    browsable = no
    writable = yes

The invalid users option, like valid users, can take group names, preceded by an at sign (@), as well as usernames. In the event that a user or group appears in both lists, the invalid users option takes precedence, and the user or group is denied access to the share.

At the other end of the spectrum, you can explicitly specify users who will be allowed superuser (root) access to a share with the admin users option. An example follows:

[sales]
        path = /home/sales
        comment = Sedona Real Estate Sales Data
        writable = yes
        valid users = sofie shelby adilia
        admin users = mike

This option takes both group names and usernames. In addition, you can specify NIS netgroups by preceding them with an @ as well; if the netgroup is not found, Samba will assume that you are referring to a standard Unix group.

Be careful if you assign administrative privileges to a share for an entire group. The Samba Team highly recommends you avoid using this option, as it essentially gives root access to the specified users or groups for that share.

If you wish to force read-only or read/write access on users who access a share, you can do so with the read list and write list options, respectively. These options can be used on a per-share basis to restrict a writable share or to grant write access to specific users in a read-only share, respectively. For example:

[sales]
        path = /home/sales
        comment = Sedona Real Estate Sales Data
        read only = yes
        write list = sofie shelby

The write list option cannot override Unix permissions. If you've created the share without giving the write-list user write permission on the Unix system, she will be denied write access regardless of the setting of write list


Пользователь решил продолжить мысль 22 Марта 2014, 00:26:12:
full version:

http://www.samba.org/samba/docs/using_samba/

 

Страница сгенерирована за 0.016 секунд. Запросов: 21.