Jump to content

Different Samba Shares


Guest CaptainRegular
 Share

Recommended Posts

Guest CaptainRegular

Ok, I ALMOST got my smb.conf setup the way I want it, but I'm having some trouble doing something that I'm not exactly sure I'm even trying to implement it correctly. I want 3 different SMB shares on one MDK10 machine.

 

1. /home/user/netshare

All contents open, no password prompt needed to access it, you click on the machine and it shows up and you can READ the files.

 

2. /home/user/pubdrv

A public network drive. Anybody on the network can read AND write to this directory. Used for photo editing from a laptop to other machine, currently in-use documents on multiple machines, things like that.

 

3. /home/user

The WHOLE directory, but I want access to it restricted to a username and password. Let's call the user "bob" and password is "pass" I want to be able to open the machine in Network Neighborhood and do the first two shares without even getting a password, prompt, which I can do now. I also have a printer shared in this fashion, as well. But I want a password prompt when I click on the third share, which I'll call "access" I'm posting a copy of my smb.conf file here, I know there's some redundant stuff in it for the free shares, but it works NOW, my question is how do I add the third share without changing the other two?

 

[global]

load printers = yes

printcap name = cups

printing = cups

netbios name = linuxbox

security = share

guest ok = yes

guest account = user

guest = user

workgroup = WORKGROUP

print command = lpr-cups -P %p -o raw %s -r

 

[linux]

path = /home/user/netshare

writeable = no

security = share

guest ok = yes

guest account = user

guest = user

 

[pubdrv]

path = /home/user/pubdrv

writeable = yes

security = share

guest ok = yes

guest account = user

guest = user

 

 

[printers]

comment = DeskJet

path = /var/spool/samba

browseable = no

public = yes

guest ok = yes

writable = no

printable = yes

printer admin = root

 

 

Not sure what to do here, anything I try either leaves it open to be viewed, passwords ALL the folders on the machine, or leaves it all open to WRITE. Help! I'm getting better, but I'm still a Linux n00b.

Link to comment
Share on other sites

Guest CaptainRegular

Update:

 

I think it might be possible to get passworded write access (this would be the only instance a pass prompt comes up) by using

 

[homes]

comment = Home Directories

writeable = yes

browseable = No

 

Somewhere in there. Would I need to change the security to = user, or can I leave it as share? I REALLY don't want to make the other folders passworded. Is Samba even capable of doing this? I've heard of people using TWO instances of samba running on one machine, I guess if that's possible and needed for this, I could make one user and the other share, but that seems REALLY out of the way, especially for Linux, which is seeming to be able to do just about anything.

 

Also curious about how to assign a login/password combination to this share. I don't care if I have to make a new user or not, but I'd like to be able to do this from any WinXP box without installing new users on it.

Link to comment
Share on other sites

  • 2 weeks later...
Guest jamie.s

To do this you need to make a new user called "bob" with useradd, and then passwd it to whatever at all. It does not need to be the network password.

 

You most likely don't want "bob" to be able to log onto your machine, so in /etc/passwd, change bob's shell to /bin/false and remove his home directory.

 

Then smbpasswd -a bob will let you give bob a network password for samba access.

 

Finally, create a share

 

[userdir]

path=/home/user

valid users = bob

browseable = No

write list = bob

 

This will allow only bob to login to this share, and he will be able to write to it as well.

 

Hope this helps

 

J

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...