Tried it many times but never get the SMB sharing right on Unix. A minimal Debian file server, no GUI, just SSH...
I always thought you set all the permissions in SMB and just found out you do it in Windows? https://www.youtube.com/watch?v=QhwOyLtArw0
Maybe then its enough to give me (Ragnar) access and all permissions on the root of the disk and create all the folder there from my windows workstation and set permissions with it?
I want two users: Ragnar and Harald
I call my disk "Records" and "Media":
Records (sdb1 | /mnt/records)
- TV records Harald
- TV records
- Down
Archiv (sdc1 | /mnt/archiv)
- Harald
--- Motorola Tablet
-Backup
--- PC1
--- PC2
-Media
--- Music
--- Music Videos
--- eBooks
Harald should be able see "Records/TV records Harald" and have read, write and delete permissions.
Harald should be able see "Archiv/Harald" and have read, write and delete permissions.
Harald should be able see "Archiv/Media" and have ONLY read permissions.
Friends who visit me should be able to see "Archiv/Media" and have ONLY read permissions.
Ragnar should be able to see and do everything everywhere.
What i did so far:
~# sudo apt install samba
~# sudo useradd Ragnar -s /usr/sbin/nologin
~# sudo smbpasswd -a Ragnar
~# sudo useradd Harald -s /usr/sbin/nologin
~# sudo smbpasswd -a Harald
~# sudo nano /etc/samba/smb.conf
[global]
workgroup = WORKGROUP
log file = /var/log/samba/log.%m
max log size = 1000
logging = file
panic action = /usr/share/samba/panic-action %d
server role = standalone server
obey pam restrictions = yes
[Records]
comment = Disk 1
path = /mnt/records
browsable = yes
read only = no
create mask = 0666
directory mask = 0777
force user = Ragnar
force group = Ragnar
hide files = /lost+found/
~# sudo chown Ragnar /mnt/records
~# sudo service smbd restart
If look at security in Windows on the "Records" share i have:
Everyone: Special permissions
root (Unix Group\root): Special permissions
Ragnar (HECTOR\Ragnar): Special permissions
Do i need to change the group somehow?
Are the "Special permissions" normal instead of showing "Full control" for Ragnar and Read, Write for Everyone?
If i now create a file in records and look at security in Windows i have:
Everyone: Read, Write
Ragnar (Unix Group\Ragnar): Read, Write
Ragnar (HECTOR\Ragnar): Read, Write
So also no "Full control" for Ragnar...
What needs to be changed?
Or do i now just create my subfolders on Windows and set the permissions there?
Then is there a way to hide that lost+found entirely?
You still see it in Windows if explorer is set to "show hidden files".
I also see it on my Android devices.
Then there is a folder IPC$ on Android?
EDIT
I cant remove Everyone on folders/files inside Records because of lost+found (access is denied).
EDIT
I did a sudo chown -R Ragnar:Ragnar /mnt/records and can now remove the permissions for Everyone.
But Harald can read and write in Records???