LinuxForum.Fans
Тема

Windows 7 + Debian шары Samba

Автор: r1sh 9 сообщений 7977 просмотров
#198231

И снова дня доброго!

Имеется две машины: Windows 7 в домене на Win2003 и Debian в рабочей группе.

Поднял на на Дебиане самбу, вот конфиг:

text

[global] workgroup = INFOSTROY server string = %h server security = SHARE obey pam restrictions = Yes pam password change = Yes passwd program = /usr/bin/passwd %u passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* . unix password sync = Yes lanman auth = No client NTLMv2 auth = Yes syslog = 0 log file = /var/log/samba/log.%m max log size = 1000 smb ports = 139 panic action = /usr/share/samba/panic-action %d

[homes] comment = Home Directories valid users = %S create mask = 0700 directory mask = 0700

[printers] comment = All Printers path = /var/spool/samba create mask = 0700 printable = Yes browseable = No

[print$] comment = Printer Drivers path = /var/lib/samba/printers

[www] path = /var/www admin users = r1sh read only = No

[home] path = /home/ admin users = r1sh read only = No

Задал пароль юзеру smbpasswd r1sh

Пытаюсь подключиться с машины Debian на нее же:
r1sh@isl-debian:~$ smbclient -L localhost
Enter r1sh's password:
Domain=[INFOSTROY] OS=[Unix] Server=[Samba 3.5.11]
Server requested LANMAN password (share-level security) but 'client lanman auth' is disabled
tree connect failed: NT_STATUS_ACCESS_DENIED

Пытаюсь подключиться с винды при автризации вводя ISL-DEBIAN/r1sh и пароль - отказ, в логе:
[2011/10/07 11:49:31.693821, 0] ../libcli/auth/ntlm_check.c:54(smb_pwd_check_ntlmv1)
smb_pwd_check_ntlmv1: incorrect password length (74)
[2011/10/07 11:49:32.819188, 1] smbd/service.c:678(make_connection_snum)
create_connection_server_info failed: NT_STATUS_WRONG_PASSWORD

Почему он пишет про ntlmv1 если в настройках сервера стоит Ntlmv2.
Нашел параметр в Локальных политиках безопасности:
Локальные политики\ Политики Безопасности \ Сетевая безопасность: уровень проверки подлинности Lan Manager
поигрался с ним - толку никакого , все равно пишет что неверный пароль....

При этом если я в винде через консоль пишу:

C:\Users\gmaleev>net use x: \\isl-debian\www
Недействительный пароль для \\isl-debian\www.

Введите имя пользователя для 'isl-debian': r1sh
Введите пароль для isl-debian:
Команда выполнена успешно.

И в логе самого smbd:

text

[2011/10/07 12:07:02.525067,  0] printing/print_cups.c:109(cups_connect)
  Unable to connect to CUPS server localhost:631 - В соединении отказано
[2011/10/07 12:07:02.525940,  0] printing/print_cups.c:468(cups_async_callback)
  failed to retrieve printer list: NT_STATUS_UNSUCCESSFUL
[2011/10/07 12:07:02.561649,  0] smbd/server.c:501(smbd_open_one_socket)
  smbd_open_once_socket: open_socket_in: Адрес уже используется
[2011/10/07 12:10:02.694041,  0] printing/print_cups.c:109(cups_connect)
  Unable to connect to CUPS server localhost:631 - В соединении отказано
[2011/10/07 12:10:02.694595,  0] printing/print_cups.c:468(cups_async_callback)
  failed to retrieve printer list: NT_STATUS_UNSUCCESSFUL
[2011/10/07 12:10:02.695586,  1] smbd/server.c:282(remove_child_pid)
  Could not find child 13834 -- ignoring

Куда копать?)

#198236
r1sh написал:
client NTLMv2 auth = Yes
Почему он пишет про ntlmv1 если в настройках сервера стоит Ntlmv2.

Думаю, потому, что

"http://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html" написал:

client ntlmv2 auth (G)
This parameter determines whether or not smbclient(8) will attempt to authenticate itself to servers using the NTLMv2 encrypted password response.
If enabled, only an NTLMv2 and LMv2 response (both much more secure than earlier versions) will be sent. Many servers (including NT4 < SP4, Win9x and Samba 2.2) are not compatible with NTLMv2.
Similarly, if enabled, NTLMv1, client lanman auth and client plaintext auth authentication will be disabled. This also disables share-level authentication.
If disabled, an NTLM response (and possibly a LANMAN response) will be sent by the client, depending on the value of client lanman auth.
Note that some sites (particularly those following 'best practice' security polices) only allow NTLMv2 responses, and not the weaker LM or NTLM.

Default: client ntlmv2 auth = no

В части сервера смотри там же:


ntlm auth (G)
This parameter determines whether or not smbd(8) will attempt to authenticate users using the NTLM encrypted password response. If disabled, either the lanman password hash or an NTLMv2 response will need to be sent by the client.
If this option, and lanman auth are both disabled, then only NTLMv2 logins will be permited. Not all clients support NTLMv2, and most will require special configuration to use it.

Default: ntlm auth = yes
#198237
bormant написал:

This parameter determines whether or not smbclient(8) will attempt to authenticate itself to servers using the NTLMv2 encrypted password response.
If enabled, only an NTLMv2 and LMv2 response (both much more secure than earlier versions) will be sent. Many servers (including NT4 < SP4, Win9x and Samba 2.2) are not compatible with NTLMv2.
Similarly, if enabled, NTLMv1, client lanman auth and client plaintext auth authentication will be disabled. This also disables share-level authentication.
If disabled, an NTLM response (and possibly a LANMAN response) will be sent by the client, depending on the value of client lanman auth.
Note that some sites (particularly those following 'best practice' security polices) only allow NTLMv2 responses, and not the weaker LM or NTLM.

Default: client ntlmv2 auth = no

все равно не понял, ну он говорит что если включить NTLMv2 соответственно автризация через lanman или открытым текстом не будет работать и дизейблит аутентификацию share.

Samba 3.5.1 по умолчанию юзает NTLMv2 судя по описанию. Значит выходит винда пытается авторизоваться иначе? Только в этом может быть проблема?

Судя по статье нужно изменить ключ реестра.

Вот список всех вохможных ключей, у меня стоит 200000

Так же в реестре у меня стоит "Отправлять LM и NTLM - использовать сеансовую безопасность NTLMv2 по принуждению"

что может помешать аутентификации?

#198238

Потому. Это настройка клиента (smbclient), а не сервера (smbd). Про настройку сервера дополнил предыдущее сообщение.

ps. Вывод про умолчания неправильный.

#198241

r1sh,
не распыляйтесь. Про реестр -- пока преждевременно. Было сказано:

r1sh написал:
Пытаюсь подключиться с машины Debian на нее же:
r1sh@isl-debian:~$ smbclient -L localhost
Enter r1sh's password:
Domain=[INFOSTROY] OS=[Unix] Server=[Samba 3.5.11]
Server requested LANMAN password (share-level security) but 'client lanman auth' is disabled
tree connect failed: NT_STATUS_ACCESS_DENIED

Пытаюсь подключиться с винды при автризации вводя ISL-DEBIAN/r1sh и пароль - отказ, в логе:
[2011/10/07 11:49:31.693821,  0] ../libcli/auth/ntlm_check.c:54(smb_pwd_check_ntlmv1)
  smb_pwd_check_ntlmv1: incorrect password length (74)
[2011/10/07 11:49:32.819188,  1] smbd/service.c:678(make_connection_snum)
  create_connection_server_info failed: NT_STATUS_WRONG_PASSWORD

Почему он пишет про ntlmv1 если в настройках сервера стоит Ntlmv2.

Я вам ответил, что в настройках сервера, судя по логам, у вас стоит ntlmv1, а ntlmv2 стоит в настройках клиента, а не сервера.
Так понятнее?

Только NTLMv2 сервера -- это:

text

ntlm auth = no
lanman auth = no

Пожалуйста, будьте внимательнее при чтении документации.

#198242

Странно просто что одновременно были две эти опции включены по-умлочанию.

Т.е. как я понял для того чтобы и сервер и клиент общались на NTLMv2 нужно сделать:

ntlm auth = no
lanman auth = no
client ntlmv2 auth = yes

и самое главное блин забыл

security = USER

теперь заработало)) спасибо огромное за помощь!

#198243

В документации есть один момент на этот счёт:

client ntlmv2 auth (G)
...
If enabled, only an NTLMv2 and LMv2 response (both much more secure than earlier versions) will be sent. Many servers (including NT4 < SP4, Win9x and Samba 2.2) are not compatible with NTLMv2.
Similarly, if enabled, NTLMv1, 'client lanman auth' and 'client plaintext auth' authentication will be disabled. This also disables share-level authentication.

ps. Ага, вижу, про 'share level' уже и сами нашли.

#198245
bormant написал:
В документации есть один момент на этот счёт:

client ntlmv2 auth (G)
...
If enabled, only an NTLMv2 and LMv2 response (both much more secure than earlier versions) will be sent. Many servers (including NT4 < SP4, Win9x and Samba 2.2) are not compatible with NTLMv2.
Similarly, if enabled, NTLMv1, 'client lanman auth' and 'client plaintext auth' authentication will be disabled. This also disables share-level authentication.

ps. Ага, вижу, про 'share level' уже и сами нашли.

нашел) я эту строчку понимал в том смысле, что ставя client ntlmv2 auth (G) = enable он автоматом стави тsecurity = user по этому и не придавал этому значения....

#198251

"он" -- это вы про Samba, да? Основная ошибка -- в единственном числе.
smb.conf -- это файл конфигурации не только серверов в составе Samba (smbd, nmbd, winbindd), но и клиента (smbclient). Параметры клиента как раз и имеют вид "client ...".

Войдите или зарегистрируйтесь, чтобы ответить.