Samba не видит содержимого расшаренной папки Windows

Простые/общие вопросы по UNIX системам. Спросите здесь, если вы новичок

Модераторы: vadim64, terminus

Правила форума
Убедительная просьба юзать теги [cоde] при оформлении листингов.
Сообщения не оформленные должным образом имеют все шансы быть незамеченными.
argkh
проходил мимо
Сообщения: 6
Зарегистрирован: 2013-04-25 22:05:05

Samba не видит содержимого расшаренной папки Windows

Непрочитанное сообщение argkh » 2013-06-26 14:01:06

Пытаюсь подключить к компу с FreeBSD 8.2 сетевой диск WD, samba36-3.6.5.
Делал вот по этой статье - http://www.lissyara.su/articles/freebsd ... unt_smbfs/, подключается без проблем, но в расшаренной папке не видно ни одного файла. Подскажите, что делать.

Вывод команд:

Код: Выделить всё

$ sudo mount_smbfs -N //argkh@MyBookLive/Public /media/LIBRARY
$ mount
/dev/ad4s2a on / (ufs, local)
devfs on /dev (devfs, local, multilabel)
/dev/ad4s2e on /tmp (ufs, local, soft-updates)
/dev/ad4s2f on /usr (ufs, local, soft-updates)
/dev/ad4s2d on /var (ufs, local, soft-updates)
/dev/ad4s1f on /mnt/yaroslav (ufs, local, soft-updates)
linsysfs on /usr/compat/linux/sys (linsysfs, local)
linprocfs on /usr/compat/linux/proc (linprocfs, local)
/dev/md0 on /tmp (ufs, local)
//ARGKH@MYBOOKLIVE/PUBLIC on /media/LIBRARY (smbfs)
$ cd /media/LIBRARY
$ ls
$ 
Через smbclient подключается и всё видит нормально:

Код: Выделить всё

$ smbclient -I 192.168.1.11 //argkh@MyBookLive/Public
Enter argkh's password: 
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.2.5]
smb: \> ls
  .                                   D        0  Tue Jun 25 22:44:14 2013
  ..                                  D        0  Wed Jun 26 02:52:55 2013
  New                                 D        0  Tue Jun 25 21:44:46 2013
  metadata.db                                  0  Tue Jun 25 21:48:12 2013
  Pictures                            D        0  Sun Jun 23 20:10:27 2013
  Calibre Наука                  D        0  Mon Jun 24 16:47:32 2013
  Demystifying paradoxes.pdf             4158259  Thu Aug 10 00:39:24 2006
  Videos                              D        0  Mon Jun 24 15:13:13 2013
  Music                               D        0  Sun Jun 23 20:10:27 2013
  Фото                            D        0  Sat Mar 30 15:51:08 2013

		59108 blocks of size 16777216. 51650 blocks available
smb: \> 
smb.conf:

Код: Выделить всё

[global]

# workgroup = NT-Domain-Name or Workgroup-Name, eg: MIDEARTH
   workgroup = WORKGROUP
   netbios name = BSD-8

# server string is the equivalent of the NT Description field
#   server string = argkh

# Security mode. Defines in which mode Samba will operate. Possible 
# values are share, user, server, domain and ads. Most people will want 
# user level security. See the Samba-HOWTO-Collection for details.
   security = share

# This option is important for security. It allows you to restrict
# connections to machines which are on your local network. The
# following example restricts access to two C class networks and
# the "loopback" interface. For more examples of the syntax see
# the smb.conf man page
;   hosts allow = 192.168.1.1 192.168.1.2. 192.168.1.3 192.168.1.4 192.168.1.5  192.168.1.6  192.168.1.7  192.168.1.11	127.

# If you want to automatically load your printer list rather
# than setting them up individually then you'll need this
   load printers = yes

# you may wish to override the location of the printcap file
;   printcap name = /etc/printcap

# on SystemV system setting printcap name to lpstat should allow
# you to automatically obtain a printer list from the SystemV spool
# system
;   printcap name = lpstat

# It should not be necessary to specify the print system type unless
# it is non-standard. Currently supported print systems include:
# bsd, cups, sysv, plp, lprng, aix, hpux, qnx
;   printing = cups

# this tells Samba to use a separate log file for each machine
# that connects
   log file = /var/log/samba/log.%m

# Put a capping on the size of the log files (in Kb).
   max log size = 50
..................................
# WINS Proxy - Tells Samba to answer name resolution queries on
# behalf of a non WINS capable client, for this to work there must be
# at least one	WINS Server on the network. The default is NO.
;   wins proxy = no

# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names
# via DNS nslookups. The default is NO.
   dns proxy = no 

# Charset settings
;   display charset = UTF-8
;   unix charset = UTF-8
;   dos charset = cp866

# Use extended attributes to store file modes
;    store dos attributes = yes
;    map hidden = no
;    map system = no
;    map archive = no

# Use inherited ACLs for directories
;    nt acl support = yes
;    inherit acls = yes
;    map acl inherit = yes 

# These scripts are used on a domain controller or stand-alone 
# machine to add or delete corresponding unix accounts
;  add user script = /usr/sbin/useradd %u
;  add group script = /usr/sbin/groupadd %g
;  add machine script = /usr/sbin/adduser -n -g machines -c Machine -d /dev/null -s /bin/false %u
;  delete user script = /usr/sbin/userdel %u
;  delete user from group script = /usr/sbin/deluser %u %g
;  delete group script = /usr/sbin/groupdel %g


#============================ Share Definitions ==============================
[homes]
   comment = Home Directories
   browseable = yes
   writable = yes
   path = /usr/home/%u/
   valid users = %S

# Un-comment the following and create the netlogon directory for Domain Logons
; [netlogon]
;   comment = Network Logon Service
;   path = /usr/local/samba/lib/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 = /usr/local/samba/profiles
;    browseable = yes
;    guest ok = yes


# NOTE: If you have a BSD-style print system there is no need to 
# specifically define each individual printer
[printers]
   comment = All Printers
   path = /var/spool/samba34
   browseable = no
# Set public = yes to allow user 'guest account' to print
   guest ok = no
   writable = no
   printable = no

# This one is useful for people to share files
;[tmp]
;   comment = Temporary file space
;   path = /tmp
;   read only = no
;   public = 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

# A publicly accessible directory, that can be read from
# or written to by all valid users.
[public]
   comment = bsd-8 Shared Public Directory
   path = /usr/home/argkh/Samba
   force directory mode = 0777
   force create mode = 0777
   force group = nobody
   force user = nobody
   public = yes
   writeable = yes
   read only = no

;[pchome]
;  comment = PC Directories
;  path = /usr/pc/%m
;  public = no
;  writable = yes

# A publicly accessible directory, read/write to all users. Note that all files
# created in the directory by users will be owned by the default user, so
# any user with access can delete any other user's files. Obviously this
# directory must be writable by the default user. Another user could of course
# be specified, in which case all files would be owned by that user instead.
;[public]
;   path = /usr/home/argkh/Samba/public
;   public = yes
;   only guest = yes
;   writable = yes
;   printable = no
nsmb.conf:

Код: Выделить всё

[default]
workgroup=WORKGROUP

[MYBOOKLIVE]
addr=192.168.1.11

[MYBOOKLIVE:ARGKH]
charsets=UTF-8:cp866
password=xxxxxxxxxxxxxxxxx
Локаль utf-8

Хостинговая компания Host-Food.ru
Хостинг HostFood.ru
 

Услуги хостинговой компании Host-Food.ru

Хостинг HostFood.ru

Тарифы на хостинг в России, от 12 рублей: https://www.host-food.ru/tariffs/hosting/
Тарифы на виртуальные сервера (VPS/VDS/KVM) в РФ, от 189 руб.: https://www.host-food.ru/tariffs/virtualny-server-vps/
Выделенные сервера, Россия, Москва, от 2000 рублей (HP Proliant G5, Intel Xeon E5430 (2.66GHz, Quad-Core, 12Mb), 8Gb RAM, 2x300Gb SAS HDD, P400i, 512Mb, BBU):
https://www.host-food.ru/tariffs/vydelennyi-server-ds/
Недорогие домены в популярных зонах: https://www.host-food.ru/domains/

mikie
мл. сержант
Сообщения: 84
Зарегистрирован: 2012-11-21 18:33:03

Re: Samba не видит содержимого расшаренной папки Windows

Непрочитанное сообщение mikie » 2013-06-26 14:34:52

скорее всего дело в кодировке
если папка разшарена в виндовсе то пробуйте так
nsmb.conf:

Код: Выделить всё

charsets=koi8-r:cp866
или

Код: Выделить всё

charsets=cp866:cp1251

Гость
проходил мимо

Re: Samba не видит содержимого расшаренной папки Windows

Непрочитанное сообщение Гость » 2013-06-26 15:38:30

Спасибо, попробовал - не помогает. Из-под винды папка расшарена, под виндой и с андроидного планшета открывается без проблем.

argkh
проходил мимо
Сообщения: 6
Зарегистрирован: 2013-04-25 22:05:05

Re: Samba не видит содержимого расшаренной папки Windows

Непрочитанное сообщение argkh » 2013-06-26 15:41:58

Спасибо, попробовал - не помогает. Из-под винды папка расшарена, под виндой и с андроидного планшета открывается без проблем.

snorlov
подполковник
Сообщения: 3927
Зарегистрирован: 2008-09-04 11:51:25
Откуда: Санкт-Петербург

Re: Samba не видит содержимого расшаренной папки Windows

Непрочитанное сообщение snorlov » 2013-06-26 16:27:12

После монтирования по sudo. уйдите в root, т.е. su ... и посмотрите видны ли файлы...

argkh
проходил мимо
Сообщения: 6
Зарегистрирован: 2013-04-25 22:05:05

Re: Samba не видит содержимого расшаренной папки Windows

Непрочитанное сообщение argkh » 2013-06-26 16:37:03

Пробовал, никакого эффекта. Пробовал также монтировать не через sudo, а из-под рута, - тоже ничего.

snorlov
подполковник
Сообщения: 3927
Зарегистрирован: 2008-09-04 11:51:25
Откуда: Санкт-Петербург

Re: Samba не видит содержимого расшаренной папки Windows

Непрочитанное сообщение snorlov » 2013-06-26 17:01:01

smbclient берет настройки из smb.conf, а mount_smbfs из nsmb.conf, запустите testparm, правда не помню с каким ключом, он вам выдаст все настройки, включая по умолчанию... дело явно либо с правами доступа либо с кодировкой...

argkh
проходил мимо
Сообщения: 6
Зарегистрирован: 2013-04-25 22:05:05

Re: Samba не видит содержимого расшаренной папки Windows

Непрочитанное сообщение argkh » 2013-06-26 18:36:17

testparm -v выдаёт множество разных настроек smb.conf, но я не вижу, как их можно приспособить к nsmb.conf, там набор очень ограниченный, судя по ману. Пробовал ещё максимум опций указывать при монтировании - вот так:

Код: Выделить всё

sudo mount_smbfs -E cp866:cp1251 -I 192.168.1.11 -M 777:777 -O argkh:wheel -U argkh -W WORKGROUP -f 777 -d 777 -N //argkh@MyBookLive/Public /media/LIBRARY
- всё равно не помогает. Разные разумные сочетания кодировок тоже пробовал.

snorlov
подполковник
Сообщения: 3927
Зарегистрирован: 2008-09-04 11:51:25
Откуда: Санкт-Петербург

Re: Samba не видит содержимого расшаренной папки Windows

Непрочитанное сообщение snorlov » 2013-06-26 20:09:46

Посмотрите кодировки, обычно юзается koi8-r:cp866... У вас локаль какая на сервере?

argkh
проходил мимо
Сообщения: 6
Зарегистрирован: 2013-04-25 22:05:05

Re: Samba не видит содержимого расшаренной папки Windows

Непрочитанное сообщение argkh » 2013-06-26 20:23:38

utf-8
Это не вполне сервер - использую FreeBSD как десктоп, и вот к десктопной машине хочу подключить сетевой диск

argkh
проходил мимо
Сообщения: 6
Зарегистрирован: 2013-04-25 22:05:05

Re: Samba не видит содержимого расшаренной папки Windows

Непрочитанное сообщение argkh » 2013-06-27 0:21:15

При этом я могу ходить по папкам, зная их имена, и записывать в них файлы (из-под рута, конечно). Записывается и в саму примонтированную расшаренную папку, но потом не отображается (видно только с других устройств или из-под винды); а вот в подпапки и пишется, и отображается потом, - и с русскими, и с латинскими именами файлов. Самх подпапок при этом не видно, нужно в них заходить наощупь.