0

I have two problems with accessing SMB shares from Windows (Windows Server 2022).

On my Linux server (EuroLinux RHEL) I installed an SMB server and got it working.

At first I had only one share (\share) and it worked and still works.

Then I wanted to use a second drive as a second share. So I mounted the /home/vault drive and set up the samba share. In Windows, this share shows up, but when I try to access it, the error message "the network name cannot be found" appears (even when I try to mount it using the net use command)

So I thought it might be a problem with the mounted drive and wanted to use a third shared folder (/test). I set up the third share just like the first, but now Windows says You do not have permissions

All shared folders have the same permission and the same configuration

chown guest <folder> && chmod 777 <folder> -R

My samba config

[root@lx-host home]# cat /etc/samba/smb.conf
[global]
    workgroup = WORKGROUP
    netbios name = lx-host
    server string = lx-host
    server role = standalone server
    passdb backend = tdbsam
    security = user
    guest account = guest
    map to guest = Bad Password

[test]
    path = /home/test
    writable = yes
    public = yes
    printable = no

[vault]
    path = /home/vault
    writable = yes
    public = yes
    printable = no

[share]
    path = /home/share
    writable = yes
    public = yes
    printable = no

My folder permissions

[root@lx-host home]# exa
drwxrwxrwx@ - guest 15 Oct 18:58 guest
drwxr-xr-x@ - root  28 Oct 12:07 iso
drwxr-xr-x@ - root   9 Nov 09:33 prog
drwxrwxrwx@ - guest  9 Nov 02:57 share
drwxrwxrwx@ - guest 11 Nov 11:04 test
drwSrwSrwx  - guest 11 Nov 10:47 vault
drwxr-xr-x@ - root  26 Oct 14:46 vm

[root@lx-host home]# ls -l
total 4
drwxrwxrwx. 2 guest guest   62 Oct 15 18:58 guest
drwxr-xr-x. 2 root  root   170 Oct 28 12:07 iso
drwxr-xr-x. 4 root  root    39 Nov  9 09:33 prog
drwxrwxrwx. 6 guest root    57 Nov  9 02:57 share
drwxrwxrwx. 3 guest root    18 Nov 11 12:02 test
drwSrwSrwx. 3 guest root  4096 Nov 11 10:47 vault
drwxr-xr-x. 4 root  root   155 Oct 26 14:46 vm

Access from linux to smb

[root@lx-host home]# smbclient -L //lx-host -U guest
Password for [WORKGROUP\guest]:

    Sharename       Type      Comment
    ---------       ----      -------
    test            Disk      
    vault           Disk      
    share           Disk      
    IPC$            IPC       IPC Service (lx-host)

all shares seen by Windows
access to the shared folder /share works

2

2 Answers 2

0

Fixed the first problem with the mounted drive!! Because im using Eurolinux based on RHEL it uses SELinux additional security restrictions. So i need to mount the drive in an other context

 /home/vault ext4 defaults,errors=remount-ro,context="system_u:object_r:samba_share_t:s0" 0 1

https://unix.stackexchange.com/a/391677

0

Okay, i gave up looking for a 'great' solution and stuck with this 'ok' solution:

[global]
        create mask = 777
        force create mode = 777
        security mask = 777
        force security mode = 777
[vault]
        directory mask = 2777
        force directory mode = 2777
        directory security mask = 2777
        force directory security mode = 2777

For security reasons, this is not ideal, but with my LAN and the special access to it, it is fine for me.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .