wiki-grav/pages/04.other/07.samba/default.en.md
2022-06-25 11:37:54 +02:00

46 lines
1.1 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: Samba
---
[toc]
## Linux Server
`sudo apt install samba smbclient`
samba conf backup
`sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup`
*Samba users have to exist on the system as well before they are added to samba's user management system.*
Add user to samba and create a password for it
`sudo smbpasswd -a (user)`
Directories can be shared with groups or users.
Make sure to [set the owner and group](/content/linux-other/files.html) for the directories you want to share.
### Sharing with users
```
[sharename]
path = (absolute path)
read only = no
writeable = yes
browseable = yes
valid users = (user), (user 2), (user 3)
create mask = 0660
directory mask = 0770
```
### Sharing with groups
Make sure to add all users to the group
The "@" signals samba that this is a group
```
[sharename]
path = (absolute path)
read only = no
writeable = yes
browseable = yes
valid users = @(group)
create mask = 0660
directory mask = 0770
```
Finally, restart the samba service.
`sudo systemctl restart smbd`