Samba share: password required

Hi there, I’ve got some issues with my samba configuration:

  • I can see and open the main disk folder /home but I can’t add files
  • The system ask me to put a **password **
    to see Disk2 and Disk3

Please find below my smb.conf file:

smb.conf is the main Samba configuration file. You find a full commented

version at /usr/share/doc/packages/samba/examples/smb.conf.SUSE if the

samba-doc package is installed.

[global]
workgroup = SKY72359
passdb backend = tdbsam
printing = cups
printcap name = cups
printcap cache time = 750
cups options = raw
map to guest = Bad User
include = /etc/samba/dhcp.conf
logon path = \%L\profiles.msprofile
logon home = \%L%U.9xprofile
logon drive = P:
usershare allow guests = Yes
add machine script = /usr/sbin/useradd -c Machine -d /var/lib/nobody -s /bin/false %m$
domain logons = No
domain master = No
security = user
usershare max shares = 100
wins support = Yes
[homes]
comment = Home Directories
valid users = %S, %D%w%S
browseable = No
read only = No
inherit acls = Yes

[profiles]
comment = Network Profiles Service
path = %H
read only = No
store dos attributes = Yes
create mask = 0600
directory mask = 0700
guest ok = No
[users]
comment = All users
path = /home
read only = No
inherit acls = Yes
veto files = /aquota.user/groups/shares/
[groups]
comment = All groups
path = /home/groups
read only = No
inherit acls = Yes
[printers]
comment = All Printers
path = /var/tmp
printable = Yes
create mask = 0600
browseable = No
[print$]
comment = Printer Drivers
path = /var/lib/samba/drivers
write list = @ntadmin root
force group = ntadmin
create mask = 0664
directory mask = 0775

Share disabled by YaST

[netlogon]

[Doc]
comment = Doc
guest ok = Yes
inherit acls = Yes
path = /home/calimero/Documents
read only = No

[Disk3]
comment = Disk3
guest ok = Yes
inherit acls = Yes
path = /run/media/root/Disk3
read only = No
valid users = %S, %D%w%S

[Disk2]
comment = Disk2
inherit acls = Yes
path = /run/media/calimero/Disk2
read only = No
vfs objects =

Silly question: why hard disk “Disk2” and hard disk “Disk3” have different path? They are installed in two different bays in my computer

Many thanks for your help!

Hello,

I see this is your first post, welcome to the openSUSE forums.

You have chosen for OTHER VERSION, which should mean that you use an unsuported version of openSUSE. This might make it more difficult to help, but people will nevertheless try to help. You could however make this easier when you explain what version you do run (lack of clairvoyance here).

Also a technical hint:
There is an important, but not easy to find feature on the forums.

Please in the future use CODE tags around copied/pasted computer text in a post. It is the # button in the tool bar of the post editor. When applicable copy/paste complete, that is including the prompt, the command, the output and the next prompt.

An example is here: Using CODE tags Around your paste.

Silly question: why hard disk “Disk2” and hard disk “Disk3” have different path? They are installed in two different bays in my computer

Many thanks for your help!

It appears that you’re letting these mount via your desktop environment’s mounting mechanism. That uses the support of udev/udisks to do that, and determines the /run/media/ naming. The mount command will show…

mount | grep /run/media

If they are going to be permanent shares, then consider mounting via /etc/fstab instead.

https://wiki.archlinux.org/index.php/Fstab

Also, review the following samba guide re using ACLs and their effect…

https://wiki.samba.org/index.php/Setting_up_a_Share_Using_POSIX_ACLs#Adding_a_Share

Thank you for your reply Deano! Done with Yast > Partitioner. Seems to be fine! Unfortunately I’m still in trouble for HD share

Thank you Deano… But I’m still in trouble… same issue… I don’t know how to solve the problem.

I am afraid we still do not know which version of openSUSE you use :frowning:

Hi Henk,

OpenSuse Leap 42.1.20170515

Many thanks for your help!

Now I can see the content but I can’t write/modify the files.

The problem was in the mount folder settings run > media > calimero > Disk2 and run > media > calimero > Disk3 : the “Share with Samba” option was not activated in Properties> Share tab.

Thanks for your suggestions!

Giovanni

A permissions issue - all part of the learning :wink:

Permission precedence

Samba comes with different types of permissions for share. Try to remember few things about UNIX and Samba permissions.
(a) Linux system permissions take precedence over Samba permissions. For example if a directory does not have Linux write permission, setting samba writeable = Yes (see below) will not allow to write to shared directory / share.
(b) The filesystem permission cannot be take priority over Samba permission. For example if filesystem mounted as readonly setting writeable = Yes will not allow to write to any shared directory or share via samba server.

https://www.cyberciti.biz/tips/how-do-i-set-permissions-to-samba-shares.html

Thank you very much for your reply Deano.

  • Disk2: I tried to change the folder/HD permissions in File Manager - Super User mode but in the Permissions tab when I change Group properties and Others properties to *Can view and modify content *
    this option has not been saved. - Disk3: even if Permissions for Owner and Group are Can view and modify content, I can’t see the folder content in my Win10 PC

Thank you.

Regards,

Giovanni

You’d need to show us the permissions of the partitions in order for us to advise further about that. Also the fstab entries would be important to know as well.

Another simple guide…

Dear Deano,

Thank you for your suggestion and sorry for my late reply. I tried to solve mu issue but now

  • I can read Disk2 but not write
  • I can write just in some directories of Disk3, not the whole disk

Please find below:

**smb file:
**


# smb.conf is the main Samba configuration file. You find a full commented
# version at /usr/share/doc/packages/samba/examples/smb.conf.SUSE if the
# samba-doc package is installed.
[global]
    workgroup = SKY72359
    passdb backend = tdbsam
    printing = cups
    printcap name = cups
    printcap cache time = 750
    cups options = raw
    map to guest = Bad User
    include = /etc/samba/dhcp.conf
    logon path = \\%L\profiles\.msprofile
    logon home = \\%L\%U\.9xprofile
    logon drive = P:
    usershare allow guests = Yes
    add machine script = /usr/sbin/useradd  -c Machine -d /var/lib/nobody -s /bin/false %m$
    domain logons = No
    domain master = No
    security = domain
    usershare max shares = 105
    wins support = No
    wins server = 

[homes]
    comment = Home Directories
    valid users = %S, %D%w%S
    browseable = Yes
    read only = No
    inherit acls = Yes
    guest ok = Yes
[profiles]
    comment = Network Profiles Service
    path = %H
    read only = No
    store dos attributes = Yes
    create mask = 0600
    directory mask = 0700
[users]
    comment = All users
    path = /home
    read only = No
    inherit acls = Yes
    veto files = /aquota.user/groups/shares/

[groups]
    comment = All groups
    path = /home/groups
    read only = No
    inherit acls = Yes
    guest ok = Yes
[printers]
    comment = All Printers
    path = /var/tmp
    printable = Yes
    create mask = 0600
    browseable = No
[print$]
    comment = Printer Drivers
    path = /var/lib/samba/drivers
    write list = @ntadmin root
    force group = ntadmin
    create mask = 0664
    directory mask = 0775

## Share disabled by YaST
# [netlogon]

[Disk2]
    comment = Disk2
    guest ok = Yes
    inherit acls = Yes
    path = /mnt/Disk2/
    read only = No
    vfs objects = 

[Disk3]
    comment = Disk3
    guest ok = Yes
    inherit acls = Yes
    path = /mnt/Disk3/
    read only = No
    vfs objects = 



fstab:


UUID=0b437458-fbd5-4336-b00f-8b42ed3e3643 swap                 swap       defaults              0 0
UUID=93a5d713-a5ea-457d-9a78-dad8b14dda2f /                    btrfs      defaults              0 0
UUID=93a5d713-a5ea-457d-9a78-dad8b14dda2f /boot/grub2/i386-pc  btrfs      subvol=@/boot/grub2/i386-pc 0 0
UUID=93a5d713-a5ea-457d-9a78-dad8b14dda2f /boot/grub2/x86_64-efi btrfs      subvol=@/boot/grub2/x86_64-efi 0 0
UUID=93a5d713-a5ea-457d-9a78-dad8b14dda2f /home                btrfs      subvol=@/home         0 0
UUID=93a5d713-a5ea-457d-9a78-dad8b14dda2f /opt                 btrfs      subvol=@/opt          0 0
UUID=93a5d713-a5ea-457d-9a78-dad8b14dda2f /srv                 btrfs      subvol=@/srv          0 0
UUID=93a5d713-a5ea-457d-9a78-dad8b14dda2f /tmp                 btrfs      subvol=@/tmp          0 0
UUID=93a5d713-a5ea-457d-9a78-dad8b14dda2f /usr/local           btrfs      subvol=@/usr/local    0 0
UUID=93a5d713-a5ea-457d-9a78-dad8b14dda2f /var/crash           btrfs      subvol=@/var/crash    0 0
UUID=93a5d713-a5ea-457d-9a78-dad8b14dda2f /var/lib/libvirt/images btrfs      subvol=@/var/lib/libvirt/images 0 0
UUID=93a5d713-a5ea-457d-9a78-dad8b14dda2f /var/lib/mailman     btrfs      subvol=@/var/lib/mailman 0 0
UUID=93a5d713-a5ea-457d-9a78-dad8b14dda2f /var/lib/mariadb     btrfs      subvol=@/var/lib/mariadb 0 0
UUID=93a5d713-a5ea-457d-9a78-dad8b14dda2f /var/lib/mysql       btrfs      subvol=@/var/lib/mysql 0 0
UUID=93a5d713-a5ea-457d-9a78-dad8b14dda2f /var/lib/named       btrfs      subvol=@/var/lib/named 0 0
UUID=93a5d713-a5ea-457d-9a78-dad8b14dda2f /var/lib/pgsql       btrfs      subvol=@/var/lib/pgsql 0 0
UUID=93a5d713-a5ea-457d-9a78-dad8b14dda2f /var/log             btrfs      subvol=@/var/log      0 0
UUID=93a5d713-a5ea-457d-9a78-dad8b14dda2f /var/opt             btrfs      subvol=@/var/opt      0 0
UUID=93a5d713-a5ea-457d-9a78-dad8b14dda2f /var/spool           btrfs      subvol=@/var/spool    0 0
UUID=93a5d713-a5ea-457d-9a78-dad8b14dda2f /var/tmp             btrfs      subvol=@/var/tmp      0 0
UUID=24682731682700E2 /mnt/Disk2/          ntfs-3g    users,gid=users,fmask=133,dmask=022,locale=en_GB.UTF-8 0 0
UUID=5d5f86c1-dffa-4c4a-aeed-9f61e39bf50c /mnt/Disk3/          ext4       defaults              1 2



Many thanks for your help!

Regards,

Giovanni

For Disk3 you have an ext4-formatted device with this fstab entry

UUID=5d5f86c1-dffa-4c4a-aeed-9f61e39bf50c /mnt/Disk3/          ext4       defaults              1 2

FWIW, for external devices that should be mounted when present, but ignored by systemd when absent, you can use the following options

UUID=5d5f86c1-dffa-4c4a-aeed-9f61e39bf50c /mnt/Disk3/          ext4       nofail,x-systemd.device-timeout=1ms              1 2

Some good explanation here.

You mentioned that

I can write just in some directories of Disk3, not the whole disk

This will depend on the ownership of the directories concerned. You’d need to share that info of the disk itself. Also I assume that the mount-point (/mnt/Disk3) is likely root-owned?

ls - l /mntDisk3

You could force the group and user to match the ownership so that all valid samba users are mapped as particular user…for example…

[Disk3]
    comment = Disk3
    guest ok = Yes
    force user = root
    force group = root
    path = /mnt/Disk3/
    read only = No
    vfs objects

Dear Deano,

Sorry for my late reply, I’m moving home…

Thank you very much for your suggestions, now it seems to be all fine!

Thank you!

Glad to have been of guidance. :slight_smile: