LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-03-2021, 02:41 PM   #1
raku99
LQ Newbie
 
Registered: Jun 2021
Location: Poland
Distribution: Fedora
Posts: 6

Rep: Reputation: 0
Cannot access Fedora 34 SAMBA share from Windows 10 client


Hello
I've decided to start new thread as it is my third (so far - unsuccessful) attempt to configure Samba share on Fedora 34.
I got desktop PC running mentioned Fedora 34, where i have user nasze with password X.
It is connected to the LAN and has IP of 192.168.1.20 (interface enp2s0)

Desktop has attached HDD with single NTFS partition, that is mounted
into /mnt/magazyn_02 directory - mounting parameters (from /etc/fstab:
Code:
/dev/disk/by-uuid/<disk_uuid> /mnt/magazyn_02 auto nosuid,nodev,nofail,x-gvfs-show 0 0
Both /mnt and /mnt/magazyn_02 have root as owner and full rwx access rights:
Code:
nasze@localhost ~ $ ll / | grep mnt
drwxrwxrwx.   8 root root  4096 04-29 15:43 mnt
nasze@localhost ~ $ ll /mnt | grep magazyn_02
drwxrwxrwx. 1 root  root  40960 05-31 21:17 magazyn_02
What i'd like to do:
The partition has directory _upload_f_, that i would like to make accessible via Samba using credentials for user nasze (with password X).

I've edited /etc/samba/smb.conf - contents:
Code:
[global]
	workgroup = WORKGROUP
	server string = nasze
	netbios name = nasze

	log file = /var/log/samba/log.%m
	max log size = 500
	log level = 3

	passdb backend = smbpasswd
	security = user
	dns proxy = no

[upload_f]
	comment = upload_f
	path = /mnt/magazyn_02/_upload_f_
	writeable = yes
	guest ok = no
	create mask = 0777
	directory mask = 0777
	force user = nasze
I have enabled samba in firewall - state:
Code:
nasze@localhost ~ $ firewall-cmd --list-all
FedoraWorkstation (active)
  target: default
  icmp-block-inversion: no
  interfaces: enp3s0
  sources: 
  services: dhcpv6-client mdns samba samba-client ssh vnc-server
  ports: 1025-65535/udp 1025-65535/tcp
  protocols: 
  forward: no
  masquerade: no
  forward-ports: 
  source-ports: 3389/tcp 3389/udp
  icmp-blocks: 
  rich rules:
After starting i've checked statuses for both smb and nmb:
Code:
nasze@localhost ~ $ systemctl status smb
● smb.service - Samba SMB Daemon
     Loaded: loaded (/usr/lib/systemd/system/smb.service; enabled; vendor preset: disabled)
     Active: active (running) since Thu 2021-06-03 21:15:27 CEST; 21s ago
       Docs: man:smbd(8)
             man:samba(7)
             man:smb.conf(5)
   Main PID: 29074 (smbd)
     Status: "smbd: ready to serve connections..."
      Tasks: 4 (limit: 9493)
     Memory: 6.5M
        CPU: 139ms
     CGroup: /system.slice/smb.service
             ├─29074 /usr/sbin/smbd --foreground --no-process-group
             ├─29076 /usr/sbin/smbd --foreground --no-process-group
             ├─29077 /usr/sbin/smbd --foreground --no-process-group
             └─29078 /usr/sbin/smbd --foreground --no-process-group

cze 03 21:15:27 localhost.localdomain systemd[1]: Starting Samba SMB Daemon...
cze 03 21:15:27 localhost.localdomain smbd[29074]: [2021/06/03 21:15:27.792182,  0] ../../lib/util/become_daemon.c:135(daemon_ready)
cze 03 21:15:27 localhost.localdomain smbd[29074]:   daemon_ready: daemon 'smbd' finished starting up and ready to serve connections
cze 03 21:15:27 localhost.localdomain systemd[1]: Started Samba SMB Daemon.
nasze@localhost ~ $ systemctl status nmb
● nmb.service - Samba NMB Daemon
     Loaded: loaded (/usr/lib/systemd/system/nmb.service; enabled; vendor preset: disabled)
     Active: active (running) since Thu 2021-06-03 21:15:29 CEST; 22s ago
       Docs: man:nmbd(8)
             man:samba(7)
             man:smb.conf(5)
   Main PID: 29095 (nmbd)
     Status: "nmbd: ready to serve connections..."
      Tasks: 1 (limit: 9493)
     Memory: 2.6M
        CPU: 86ms
     CGroup: /system.slice/nmb.service
             └─29095 /usr/sbin/nmbd --foreground --no-process-group

cze 03 21:15:29 localhost.localdomain systemd[1]: Starting Samba NMB Daemon...
cze 03 21:15:29 localhost.localdomain nmbd[29095]: [2021/06/03 21:15:29.134420,  0] ../../lib/util/become_daemon.c:135(daemon_ready)
cze 03 21:15:29 localhost.localdomain nmbd[29095]:   daemon_ready: daemon 'nmbd' finished starting up and ready to serve connections
cze 03 21:15:29 localhost.localdomain systemd[1]: Started Samba NMB Daemon.
... and also checked netstat:
Code:
nasze@localhost ~ $ sudo netstat -tapn | grep smb
tcp        0      0 0.0.0.0:139             0.0.0.0:*               LISTEN      29074/smbd          
tcp        0      0 0.0.0.0:445             0.0.0.0:*               LISTEN      29074/smbd          
tcp        0      0 192.168.1.20:43252      192.168.1.4:139         ESTABLISHED 9269/gvfsd-smb-brow 
tcp6       0      0 :::139                  :::*                    LISTEN      29074/smbd          
tcp6       0      0 :::445                  :::*                    LISTEN      29074/smbd
(192.168.1.4 is one of LAN routers - used as Access Point, i assume it is not relevant to the problem).

The second PC is a laptop running Windows 10 Pro - it has also user named nasze with password X (the same credentials as for Linux desktop).
It is connected to the same LAN as desktop and it is assigned with IP 192.168.1.23.

I've checked Windows workgroup using net config workstation command - it claims:
  • Workstation domain: WORKGROUP
  • Login domain: LAPTOP

I have also enabled SMB 1.0 using Turn Windows features on and off.

When i try to access \\192.168.1.20 from Windows 10 i can see upload_f share - meanwhile i can see connection from Linux:
Code:
nasze@localhost ~ $ sudo netstat -tapn | grep smb
tcp        0      0 0.0.0.0:139             0.0.0.0:*               LISTEN      29074/smbd          
tcp        0      0 0.0.0.0:445             0.0.0.0:*               LISTEN      29074/smbd          
tcp       12      0 192.168.1.20:43252      192.168.1.4:139         ESTABLISHED 9269/gvfsd-smb-brow 
tcp        0      0 192.168.1.20:445        192.168.1.23:53001      ESTABLISHED 32126/smbd          
tcp6       0      0 :::139                  :::*                    LISTEN      29074/smbd          
tcp6       0      0 :::445                  :::*                    LISTEN      29074/smbd
But if i double-click on upload_f i got access denied in Windows 10 ...

On Linux - content of /var/log/samba/log.laptop (only the part after trying to go into upload_f):
Code:
root@localhost samba $ cat log.laptop 
[2021/06/03 21:35:22.796962,  3] ../../source3/smbd/smb2_server.c:3872(smbd_smb2_request_error_ex)
  smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_ACCESS_DENIED] || at ../../source3/smbd/smb2_create.c:334
[2021/06/03 21:35:22.799333,  3] ../../lib/util/access.c:370(allow_access)
  Allowed connection from 192.168.1.23 (192.168.1.23)
[2021/06/03 21:35:22.799523,  3] ../../source3/smbd/service.c:609(make_connection_snum)
  make_connection_snum: Connect path is '/tmp' for service [IPC$]
[2021/06/03 21:35:22.799605,  3] ../../source3/smbd/vfs.c:115(vfs_init_default)
  Initialising default vfs hooks
[2021/06/03 21:35:22.799646,  3] ../../source3/smbd/vfs.c:141(vfs_init_custom)
  Initialising custom vfs hooks from [/[Default VFS]/]
[2021/06/03 21:35:22.799856,  3] ../../source3/smbd/service.c:853(make_connection_snum)
  laptop (ipv4:192.168.1.23:53001) connect to service IPC$ initially as user nasze (uid=1000, gid=1000) (pid 32126)
[2021/06/03 21:35:22.801291,  3] ../../source3/smbd/smb2_server.c:3872(smbd_smb2_request_error_ex)
  smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_FS_DRIVER_REQUIRED] || at ../../source3/smbd/smb2_ioctl.c:318
[2021/06/03 21:35:22.830810,  3] ../../source3/smbd/smb2_server.c:3872(smbd_smb2_request_error_ex)
  smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_ACCESS_DENIED] || at ../../source3/smbd/smb2_create.c:334
[2021/06/03 21:35:22.893078,  3] ../../source3/smbd/open.c:1471(open_file)
  Error opening file . (NT_STATUS_ACCESS_DENIED) (local_flags=2048) (flags=2048)
[2021/06/03 21:35:22.893186,  3] ../../source3/smbd/smb2_server.c:3872(smbd_smb2_request_error_ex)
  smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_ACCESS_DENIED] || at ../../source3/smbd/smb2_create.c:334
[2021/06/03 21:35:22.893791,  3] ../../source3/smbd/filename.c:1615(get_real_filename_full_scan)
  scan dir didn't open dir [.]
[2021/06/03 21:35:22.893856,  3] ../../source3/smbd/smb2_server.c:3872(smbd_smb2_request_error_ex)
  smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_ACCESS_DENIED] || at ../../source3/smbd/smb2_create.c:334
[2021/06/03 21:35:22.896031,  3] ../../source3/smbd/open.c:1471(open_file)
  Error opening file . (NT_STATUS_ACCESS_DENIED) (local_flags=2048) (flags=2048)
[2021/06/03 21:35:22.896137,  3] ../../source3/smbd/smb2_server.c:3872(smbd_smb2_request_error_ex)
  smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_ACCESS_DENIED] || at ../../source3/smbd/smb2_create.c:334
[2021/06/03 21:35:22.896700,  3] ../../source3/smbd/filename.c:1615(get_real_filename_full_scan)
  scan dir didn't open dir [.]
[2021/06/03 21:35:22.896762,  3] ../../source3/smbd/smb2_server.c:3872(smbd_smb2_request_error_ex)
  smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_ACCESS_DENIED] || at ../../source3/smbd/smb2_create.c:334
[2021/06/03 21:35:22.898846,  3] ../../source3/smbd/open.c:1471(open_file)
  Error opening file . (NT_STATUS_ACCESS_DENIED) (local_flags=2048) (flags=2048)
[2021/06/03 21:35:22.898948,  3] ../../source3/smbd/smb2_server.c:3872(smbd_smb2_request_error_ex)
  smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_ACCESS_DENIED] || at ../../source3/smbd/smb2_create.c:334
[2021/06/03 21:35:22.901515,  3] ../../source3/smbd/open.c:1471(open_file)
  Error opening file . (NT_STATUS_ACCESS_DENIED) (local_flags=2048) (flags=2048)
[2021/06/03 21:35:22.901618,  3] ../../source3/smbd/smb2_server.c:3872(smbd_smb2_request_error_ex)
  smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_ACCESS_DENIED] || at ../../source3/smbd/smb2_create.c:334
[2021/06/03 21:35:22.905223,  3] ../../source3/smbd/open.c:1471(open_file)
  Error opening file . (NT_STATUS_ACCESS_DENIED) (local_flags=2048) (flags=2048)
[2021/06/03 21:35:22.905324,  3] ../../source3/smbd/smb2_server.c:3872(smbd_smb2_request_error_ex)
  smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_ACCESS_DENIED] || at ../../source3/smbd/smb2_create.c:334
[2021/06/03 21:35:22.909158,  3] ../../source3/smbd/smb2_server.c:3872(smbd_smb2_request_error_ex)
  smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_ACCESS_DENIED] || at ../../source3/smbd/smb2_create.c:334
[2021/06/03 21:35:24.909667,  3] ../../source3/smbd/open.c:1471(open_file)
  Error opening file . (NT_STATUS_ACCESS_DENIED) (local_flags=2048) (flags=2048)
[2021/06/03 21:35:24.909718,  3] ../../source3/smbd/smb2_server.c:3872(smbd_smb2_request_error_ex)
  smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_ACCESS_DENIED] || at ../../source3/smbd/smb2_create.c:334
[2021/06/03 21:35:33.509633,  3] ../../source3/smbd/service.c:1124(close_cnum)
  laptop (ipv4:192.168.1.23:53001) closed connection to service IPC$
dmesg does not show anything related to Samba.

I've tried to grep through SELinux logs using:
Code:
cat /var/log/audit/audit.log | grep -E "smb|upload"
but it seems it only contains service start / stop.

Any suggestions would be highly appreciated - it is more than frustrating

Thank You in advance and best regards !!
 
Old 06-06-2021, 04:26 PM   #2
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,842

Rep: Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148
Focussing on the user credentials and your statements....
Quote:
I got desktop PC running mentioned Fedora 34, where i have user nasze with password X.
Quote:
The second PC is a laptop running Windows 10 Pro - it has also user named nasze with password X (the same credentials as for Linux desktop).
It is connected to the same LAN as desktop and it is assigned with IP 192.168.1.23.
Does this user exist as a samba user (unrelated to the Linux user)?
Code:
sudo pdbedit -L -v
https://wiki.samba.org/index.php/Set...l_User_Account


BTW, there should be no reason to enable SMB1 in modern samba environments.
 
Old 06-06-2021, 04:43 PM   #3
raku99
LQ Newbie
 
Registered: Jun 2021
Location: Poland
Distribution: Fedora
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by ferrari View Post
Focussing on the user credentials and your statements....


Does this user exist as a samba user (unrelated to the Linux user)?
Code:
sudo pdbedit -L -v
https://wiki.samba.org/index.php/Set...l_User_Account


BTW, there should be no reason to enable SMB1 in modern samba environments.
Hi ferrari
Thanks for Your reply!
Yes, there is Samba user nasze; i was wondering, if it is really needed in case i use force user?
Besides that - today accidentally i've found that it is SELinux that prevents accessing the share -
despite there is no info about blocking in SELinux log share becomes accessible when i disable SELinux (setenforce -> 0).
Now i must figure out how to configure SELinux to allow access without disabling it - there are some docs for it.
Thanks anyway !
Filip
 
Old 06-06-2021, 05:39 PM   #4
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,842

Rep: Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148Reputation: 1148
Thanks for the update. Yes, a samba user is required.

Some notes on SElinux and samba here...

https://fedoraproject.org/wiki/SELinux/samba
https://fedoramagazine.org/fedora-32...ng-with-samba/
https://www.lisenet.com/2016/samba-server-on-rhel-7/
 
1 members found this post helpful.
Old 07-06-2021, 02:44 AM   #5
raku99
LQ Newbie
 
Registered: Jun 2021
Location: Poland
Distribution: Fedora
Posts: 6

Original Poster
Rep: Reputation: 0
Hello again after longer break
Thanks for sharing links, i'll try to adjust SElinux to have issue fully resolved.
Best regards !
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Samba share access from XP works - Win 7 share access disappear after about 3 minutes rylan76 Linux - Networking 1 11-03-2012 06:00 AM
[SOLVED] samba cannot access share from windows 7 ted_chou12 Linux - Software 3 08-15-2012 09:14 PM
access samba mounted share from client Avinazz Linux - Server 4 01-24-2010 11:13 PM
Cannot access Samba Share in Fedora 9 nzblade Linux - Software 7 07-15-2009 06:31 PM
How to share a printer attached to windows xp client from Ubuntu 8.04 client dipakds Linux - Newbie 1 06-15-2009 07:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration