First, you need to clean up something:
Code:
gksu gedit /etc/samba/smb.conf
Look for the following line:
and place a # sign in front of them so it looks like this:
Then restart samba:
Code:
sudo service smbd restart
Second, Just to be clear of your requirements, you want to:
Create a restricted share
Restrict access to a given subdirectory of that share to one specific user
You would have to ask for one of the few examples where ACL's is the classic way to accomplish this.
Since ACL's didn't work out for you so well I suggest the following as an example.
I am going to create a directory that I want to share and a subdirectory that I will restrict access to only one user:
Code:
sudo mkdir /home/Shared
sudo mkdir /home/Shared/User1
I'm going to set the permissions on those directories to enable samba to allow remote access:
Code:
sudo chmod 0777 /home/Shared
sudo chmod 0700 /home/Shared/User1
I'm going to set ownership of the subdirectory to user1:
Code:
sudo chown user1 /home/Shared/User1
Now I'm going to create a share for /home/Shared:
Code:
[Shared]
path = /home/Shared
inherit permissions = yes
writeable = yes
valid users = user1, user2, user3, user4
This will allow user1/2/3/4 to access /home/Shared only after submitting a valid username and password.
Only user1 will be allowed access to /home/Shared/User1.
You will of course need to set up user1/2/3/4 on the server and also set up samba passwords for those users.
If you need it, the following procedure will create a user1/2/3/4 account on the server that have no local server login capabilities so they will only be used for samba purposes:
Code:
sudo useradd -s /bin/true user1
sudo smbpasswd -a user1
The first command will create a local server user and the second will add AND enable a samba password for that user.
Bookmarks