With READ ONLY access to the “music” and “videos” folders for the rest of the household. I need full access to the datadrive on sdc1 so I can add or delete files when I need to, so I need to set up a password protected SMB share to the drive.
First, install the libpam-smbpass package which should sync the system users to the Samba user database
server@mediaserver:~$ sudo apt-get install libpam-smbpas
With that done we need to add the new share to /etc/samba/smb.conf
I’m going to add the whole drive as a single SMB share.
server@mediaserver:~$ sudo nano /etc/samba/smb.conf
Append the new SMB share data.
[datadrive] comment = mediaserver's data drive path = /media/sdc1 browsable = yes guest ok = no read only = no create mask = 0755
Because I normally log in using the “server” username, I’ll use this account for the SMB share.
I could not log in from my desktop PC until I had set the password via smbpasswd so I had to set it using the command below.
server@mediaserver:~$ sudo smbpasswd -a server
New SMB password:
Retype new SMB password:
Now I can find the SMB share via network in Nautilus (Ubuntu), Network places (Windows XP) enter the username and password and have full read / write access to the whole datadrive. While everyone else has only read access to “music” and “videos”