How does one enable SMB?
The RedHat 8 documentation indicates that SMB can be enabled with systemctl but I get an error:
# systemctl enable --now smb
Failed to enable unit: Unit file smb.service does not exist.
Even though Samba is installed, it looks like I don’t have systemctl units for it:
# systemctl list-unit-files | grep smb
# systemctl list-unit-files | grep samba
# rpm -qa | grep samba
samba-common-4.14.5-10.el8_5.noarch
samba-common-libs-4.14.5-10.el8_5.x86_64
samba-client-libs-4.14.5-10.el8_5.x86_64
Are unit files installed separately?
What am I missing?
Mike
UPDATE:
As sweh already mentioned, I needed to install the samba package to get the server.
Since I already started this post I might as well finish it properly.
The path of least resistance to a fully working but minimalistic SMB share is as follows:
# dnf install samba
# vi /etc/samba/smb.conf
[global]
workgroup = SAMBA
security = user
local master = no
wins support = no
load printers = no
[someshare]
path = /path/to/shared/dir
valid users = someuser
writable = yes
# smbpasswd -a someuser
# smbpasswd -e someuser
# firewall-cmd --permanent --add-port=445/tcp
# firewall-cmd --reload
# systemctl restart smb
Note that the RH docs recommend the following for the firewall-cmd:
# firewall-cmd --permanent --add-port={139/tcp,445/tcp}
However port 139 is only for SMB1 which is disabled on new Windows systems.
Note that if SELinux is set to enforcing, it will block new SMB connections. Clients, like smbclient, will get an error:
$ smbclient //rocky.soho.lan/someshare
Password for [SAMBA\someuser]:
tree connect failed: NT_STATUS_BAD_NETWORK_NAME
I elected to disable SELinux because this is for an SOHO server and I’m positive that I’ll never be hacked ever!
To disable SELinux do:
# vi /etc/sysconfig/selinux
SELINUX=disabled
Then reboot.