Main configuration
- Location
/etc/samba/smb.conf
- = INI-file
Enterprise Linux
HOGENT applied computer science
Set up the test environment
$ cd elnx-syllabus/demo
$ vagrant up fs
[...]
A working VM this time!
Samba as AD DC is not discussed here
sudo dnf install samba samba-client
sudo systemctl enable --now nmb
sudo systemctl enable --now smb
sudo firewall-cmd --add-service samba
nmbd
: NetBIOS name server
\\server\share
smbd
Check with ss
!
Service | Port |
---|---|
NetBIOS | 137/udp |
138/udp | |
SMB | 139/tcp |
445/tcp |
/etc/samba/smb.conf
/var/lib/samba/private/passdb.tdb
[global]
netbios name = files
workgroup = AVALON
server string = "Avalon, Inc. file server"
wins support = yes
local master = yes
domain master = yes
preferred master = yes
Test with
nmblookup -U 192.168.56.12 files
nmblookup files
Managing (r/w) access to shares is hard!
2 groups, 2 users in each group:
User | Group |
---|---|
sparrow | pirates |
teach | pirates |
fuma | ninjas |
hattori | ninjas |
Password = username
# tree /srv/shares/
/srv/shares/
├── cove
│ └── everyone.txt
├── dojo
│ └── ninjas.txt
└── everyone
└── pirates.txt
smbclient -L //server/
smbclient //server/share -Ualice%letmein
smbclient //server/share -U%
Setting | Purpose |
---|---|
browseable | share is visible |
valid users | read access |
read only/writeable | write access |
samba_share_t
public_content_t
journalctl -u nmb.service
journalctl -u smb.service
tail -f /var/log/audit/audit.log
testparm -s
smbclient
instead of Windows file manager