Вот мой файл smb.conf. Что с этим не так?

Я уменьшил это почти до 0 безопасности. я пробовал security = user, Я не могу на своей Windows-машине увидеть эти общие диски. У меня также было имя netbios, равное имени моей рабочей группы. Если бы кто-то мог сказать мне, если здесь что-то не так, это было бы хорошо.

[global]
workgroup = SOLARSYSTEM
netbios = SUN
server string = Solarsystem Samba Server
security = share
force user = dwarf

[movies] 
comment = entire shared drive 
path = /mnt/media/movies 
read only = no
guest ok = yes
writable = yes

1 ответ

Решение

Есть несколько вещей, которые вы должны знать о файле конфигурации samba. Ну, я лгу. Вам нужно многое узнать (мне пришлось потратить пару дней на чтение руководства). Но в целом все зависит от того, откуда вы делитесь папкой.

Если папка находится в вашей домашней папке, вы можете просто щелкнуть правой кнопкой мыши по папке, выбрать общий доступ и следовать предоставленным параметрам. Простое решение.

Если папка находится за пределами вашей домашней папки, например, в /media/username/moviesсамый быстрый способ публикации папки - это [global] раздел в файле smb.conf force user = USERNAME где username - ваш пользователь или владелец общей папки. This has several security implications but is nonetheless, the fastest way of sharing if you are on a LAN and trust the rest of the group.

If you already did the 2 mentioned above for each case, you then need to check if you are actually on the same LAN network (Check IP class), same subnet and same workgroup. For the latter, you can change the workgroup in the smb.conf under the workgroup = переменная.

If you already have done all the steps mentioned above then we proceed to see if the permissions are correct:

  • Does the share folder actually have the username as owner?
  • Does the share folder have read/write/execute permissions?
  • Can you access the shared folder from another Ubuntu PC or another version of Windows?

Depending on this answers you can most likely know where the problem is coming from. Most of the time, it is, in my case, a Windows 8 problem. Windows 8 has several options that you need to change in the "Network & Sharing" menu in order to see the LAN correctly (This applies not only to seeing Ubuntu shared resources but also other Windows versions like XP and 7).

There are tools to simplify the sharing of folders outside the home folder like the system-config-samba package, but they help to a degree. Вы также можете проверить man smb.conf to see a lot of information regarding this file, specially the part about security which I would recommend reading this https://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/ServerType.html which is better for the eye than the man pages. Specially the part about security = user,

Here is an example of a working samba share /media/cyrex/movies working for another Windows 7, Windows 8 and 2 Ubuntu PCs in the same IP range and Workgroup:

[global]
    workgroup = WORKGROUP
    server string = %h server (Samba, Ubuntu)
    dns proxy = no
    force user = cyrex
    log file = /var/log/samba/log.%m
    max log size = 1000
    syslog = 0
    panic action = /usr/share/samba/panic-action %d
    encrypt passwords = true
    obey pam restrictions = yes
    unix password sync = yes
    passwd program = /usr/bin/passwd %u
    passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
    pam password change = yes
    map to guest = bad user
    usershare allow guests = yes

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

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

[movies]
    path = /media/cyrex/titan/movies
    browseable = yes
    guest ok = yes

The only lines I added where the force user = cyrex в [global] section and the section for the [movies] which was made by the system-config-samba app but you can also do it by hand.

After that just sudo service smbd restart and wait a couple of seconds/minutes for the switch/router/network devices to update.

Другие вопросы по тегам