无法连接到本地 Fedora Samba 共享。我做错了什么?

无法连接到本地 Fedora Samba 共享。我做错了什么?

网络新手。在 Fedora Server 中创建了一个 Samba 共享。此 Samba 共享应该连接到我创建的 raid0 池(2x4TB WD Red)。raid0 池的挂载点是/raid0pool。共享文件设置为/raid0pool/raid0share

但是,我无法从其他本地计算机(包括 Windows 10 和 Fedora Workstation)进行连接。在 Windows 10 客户端上,我尝试输入诸如 、 和 之类的连接地址\\192.168.5.207\\192.168.5.207\raid0share\完全\\192.168.5.207\raid0pool\raid0share没有运气。在 Fedora Workstation 客户端上,我输入了诸如smb://192.168.5.207/raid0shareamd之类的地址smb://192.168.5.207/raid0pool/raid0share,但没有运气。我做错了什么?

感谢您的任何反馈。

编辑 smb.conf,将 samba 共享时间改为“raid0share”,而不是“share”,以反映反馈。但是,连接问题仍然存在

其中包括我用来设置 samba 的命令集,以及我的 smb.conf 文件

[user@fedora-server /]$ sudo systemctl status smb
○ smb.service - Samba SMB Daemon
     Loaded: loaded (/usr/lib/systemd/system/smb.service; disabled; preset: disabled)
     Active: inactive (dead)
       Docs: man:smbd(8)
             man:samba(7)
             man:smb.conf(5)
[user@fedora-server /]$ ^C
[user@fedora-server /]$ sudo systemctl enable smb --now
Created symlink /etc/systemd/system/multi-user.target.wants/smb.service → /usr/lib/systemd/system/smb.service.
[user@fedora-server /]$ sudo systemctl status smb
● smb.service - Samba SMB Daemon
     Loaded: loaded (/usr/lib/systemd/system/smb.service; enabled; preset: disabled)
     Active: active (running) since Thu 2023-03-30 18:29:31 PDT; 1s ago
       Docs: man:smbd(8)
             man:samba(7)
             man:smb.conf(5)
   Main PID: 1517 (smbd)
     Status: "smbd: ready to serve connections..."
      Tasks: 3 (limit: 16590)
     Memory: 10.0M
        CPU: 41ms
     CGroup: /system.slice/smb.service
             ├─1517 /usr/sbin/smbd --foreground --no-process-group
             ├─1519 /usr/sbin/smbd --foreground --no-process-group
             └─1520 /usr/sbin/smbd --foreground --no-process-group

Mar 30 18:29:31 fedora-server systemd[1]: Starting smb.service - Samba SMB Daemon...
Mar 30 18:29:31 fedora-server smbd[1517]: [2023/03/30 18:29:31.438343,  0] ../../source3/smbd/server.c:1741(main)
Mar 30 18:29:31 fedora-server smbd[1517]:   smbd version 4.17.6 started.
Mar 30 18:29:31 fedora-server smbd[1517]:   Copyright Andrew Tridgell and the Samba Team 1992-2022
Mar 30 18:29:31 fedora-server systemd[1]: Started smb.service - Samba SMB Daemon.
[user@fedora-server /]$ ^C
[user@fedora-server /]$ firewall-cmd --get-active-zones
FedoraServer
  interfaces: enp4s0
[user@fedora-server /]$ sudo firewall-cmd --permanent --zone=FedoraServer --add-service=samba
success
[user@fedora-server /]$ sudo firewall-cmd --reload
success
[user@fedora-server /]$ sudo smbpasswd -a user
New SMB password:
Retype new SMB password:
Added user user.
[user@fedora-server /]$ cd/
bash: cd/: No such file or directory
[user@fedora-server /]$ cd /
[user@fedora-server /]$ ls
afs  bin  boot  dev  etc  home  lib  lib64  media  mnt  opt  proc  raid0pool  root  run  sbin  srv  sys  tmp  usr  var
[user@fedora-server /]$ cd
[user@fedora-server ~]$ mkdir /raid0pool/raid0share
mkdir: cannot create directory ‘/raid0pool/raid0share’: Permission denied
[user@fedora-server ~]$ sudo mkdir /raid0pool/raid0share
[user@fedora-server ~]$ cd /raid0pool
[user@fedora-server raid0pool]$ ls
lost+found  raid0share
[user@fedora-server raid0pool]$ cd
[user@fedora-server ~]$ sudo semanage fcontext --add --type "samba_share_t" "/raid0pool/raid0share(/.*)?"
[user@fedora-server ~]$ sudo restorecon -R ~/share
restorecon: lstat(/home/user/share) failed: No such file or directory
[user@fedora-server ~]$ sudo restorecon -R /raid0pool/raid0share
[user@fedora-server ~]$ sudo nano /etc/samba/smb/conf
[user@fedora-server ~]$ sudo nano /etc/samba/smb.conf
[sudo] password for user: 
[user@fedora-server ~]$ 
[user@fedora-server ~]$ cd /
[user@fedora-server /]$ ls
afs  bin  boot  dev  etc  home  lib  lib64  media  mnt  opt  proc  raid0pool  root  run  sbin  srv  sys  tmp  usr  var
[user@fedora-server /]$ cd /raid0pool
[user@fedora-server raid0pool]$ ls
lost+found  raid0share
[user@fedora-server raid0pool]$ cd /raid0pool/raid0share
[user@fedora-server raid0share]$ ls
[user@fedora-server raid0share]$ cd
[user@fedora-server ~]$ sudo nano /etc/samba/smb.conf
[user@fedora-server ~]$ sudo systemctl restart smb
[user@fedora-server ~]$ sudo systemctl status smb
● smb.service - Samba SMB Daemon
     Loaded: loaded (/usr/lib/systemd/system/smb.service; enabled; preset: disabled)
     Active: active (running) since Thu 2023-03-30 20:39:16 PDT; 7s ago
       Docs: man:smbd(8)
             man:samba(7)
             man:smb.conf(5)
   Main PID: 2953 (smbd)
     Status: "smbd: ready to serve connections..."
      Tasks: 3 (limit: 16590)
     Memory: 5.7M
        CPU: 68ms
     CGroup: /system.slice/smb.service
             ├─2953 /usr/sbin/smbd --foreground --no-process-group
             ├─2956 /usr/sbin/smbd --foreground --no-process-group
             └─2957 /usr/sbin/smbd --foreground --no-process-group

Mar 30 20:39:16 fedora-server systemd[1]: Starting smb.service - Samba SMB Daemon...
Mar 30 20:39:16 fedora-server smbd[2953]: [2023/03/30 20:39:16.559559,  0] ../../source3/smbd/server.c:1741(main)
Mar 30 20:39:16 fedora-server smbd[2953]:   smbd version 4.17.6 started.
Mar 30 20:39:16 fedora-server smbd[2953]:   Copyright Andrew Tridgell and the Samba Team 1992-2022
Mar 30 20:39:16 fedora-server systemd[1]: Started smb.service - Samba SMB Daemon.
[user@fedora-server ~]$ sudo nano /etc/samba/smb.conf
[user@fedora-server ~]$ 
[user@fedora-server ~]$ sudo nano /etc/samba/smb.conf
[userr@fedora-server ~]$ sudo pdbedit -L | grep user
[sudo] password for user: 
Sorry, try again.
[sudo] password for user: 
user:1000:user
[user@fedora-server ~]$ cat /etc/passwd | grep user
user:x:1000:1000:user:/home/user:/bin/bash
[userr@fedora-server ~]$ ls -dZ /raid0pool/raid0share
unconfined_u:object_r:samba_share_t:s0 /raid0pool/raid0share
[user@fedora-server ~]$ ls -ld /raid0pool/raid0share
drwxr-xr-x. 2 root root 4096 Mar 30 18:35 /raid0pool/raid0share
[user@fedora-server ~]$ sudo nano /etc/samba/smb.conf

Smb.conf 文件

[global]
        workgroup = SAMBA
        security = user

        passdb backend = tdbsam

        printing = cups
        printcap name = cups
        load printers = yes
        cups options = raw

        # Install samba-usershares package for support
        include = /etc/samba/usershares.conf

[homes]
        comment = Home Directories
        valid users = %S, %D%w%S
        browseable = No
        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 = @printadmin root
        force group = @printadmin
        create mask = 0664
        directory mask = 0775
[raid0share]
        comment = My Share
        path = /raid0pool/raid0share
        writeable = yes
        browseable = yes
        public = yes
        create mask = 0740
        directory mask = 0750
        write list = user

相关内容