Granting authenticated access
Samba supports granting authenticated access to shares in addition to making them available as public shares.
How to do it…
- Select the account that you want to use for authentication. All Samba share accounts must be accompanied by a Unix account. In this case, we'll user a new user called
testuser
:sudo useradd testuser
- Create a separate Samba-specific password for that account:
sudo smbpasswd –a testuser
- Modify
smb.conf
to set the valid users for the share:[myshare] path = /home/share guest ok = yes read only = yes valid users = testuser
- Access the share once again; confirming that this time, you are prompted for a username and password.
How it works…
As mentioned in the preceding, Samba users must be backed by a system ...
Get Linux Networking Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.