Files
notes/archive/ssr-kwa/manual/smb-server-centos.md
2025-04-29 16:29:52 +02:00

76 lines
1.8 KiB
Markdown

## Ressources
- <https://wiki.archlinux.org/index.php/samba#Server>
- <https://wiki.archlinux.org/title/Samba#Client>
## Intro
As is often the case the [Arch Wiki](https://wiki.archlinux.org/index.php/samba#Server) has a fantactically detailed entry on setting up and configuring a samba server.
## Simple Config
Login at the server which should act as the samba server.
- First, install samba:
```sh
yum check-update && yum install samba
```
- Next, modify/create a file at `/etc/samba/smb.conf` with the following contents (adapt this for your needs):
```sh
[global]
workgroup = SAMBA
server string = petar
security = user
guest ok = yes
map to guest = Bad Password
log file = /var/log/samba/%m.log
max log size = 50
printcap name = /dev/null
load printers = no
# Install samba-usershares package for support
include = /etc/samba/usershares.conf
[Share]
comment = Folder to share
path = /path/to/share
browseable = yes
read only = no
guest ok = no
```
- Samba requires setting a password separately from that used for login. You may use an existing user or create a new one for this purpose.
```sh
smbpasswd -a sbxadmin
```
- Existing samba users can be listed with:
```sh
pdbedit -L -v
```
- Once finished, ensure the samba service is restarted with:
```sh
systemctl restart smbd
```
## Security config on server
### Firewalld
- CentOS uses as standard local firewall `firewalld`.
```sh
firewall-cmd --permanent --add-service={samba,samba-client,samba-dc} --zone=public
```
### SELinux
SELinux not allow samba to access folders by default, to solve this, run:
```sh
setsebool -P samba_export_all_ro 1
```
## Client
Depends on client OS. Just use Windows. Noob!