Alma 9.1 Samba 配置不允许外部连接

Alma 9.1 Samba 配置不允许外部连接

我刚刚在我的家庭实验室安装了 Alma 9.1,并尝试安装 samba,一切似乎在本地运行正常。我能够运行smbclient -U user -W SAMBA -L //192.168.0.254并列出所有可用的共享,但我无法从同一网络上的另一台 Linux 计算机运行此命令。我能够在这些机器之间进行 ssh,这表明我的网络也不应该有问题。

我使用 redhat cockpit 创建了 samba 共享,然后尝试手动创建一个干净的 conf,但不起作用。两个 conf 的行为相同,允许本地连接但不允许网络连接。

错误

do_connect: Connection to 192.168.0.254 failed (Error NT_STATUS_HOST_UNREACHABLE)

smb.conf(由 Alma 和 Cockpit 修改)

# See smb.conf.example for a more detailed config file or
# read the smb.conf manpage.
# Run 'testparm' to verify the config is correct after
# you modified it.
#
# Note:
# SMB1 is disabled by default. This means clients without support for SMB2 or
# SMB3 are no longer able to connect to smbd (by default).

[global]
        workgroup = SAMBA
        security = user

        passdb backend = tdbsam

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

        include = registry
[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

[number$]
        comment = Removed
        path = /shares/Number$
        read only = No

smb.conf(最小配置)

[global]
security = user

[number$]
        writeable = yes
        valid users = USER
        path = /shares/Number$

答案1

我发现了错误,我不熟悉防火墙,也不知道这是 Alma 上的默认设置。您可以按照概述将 samba 添加到防火墙来解决这个问题这里

如果您更喜欢使用 Cockpit GUI,请单击网络选项卡。然后单击Edit rules and zones。从那里添加服务非常容易。

相关内容