Click to See Complete Forum and Search --> : Samba read/write permissions trouble


Floppyman
07-27-2003, 10:41 PM
Hi all,

I tried to setup a Samba server today. I want to share a partition off my 2nd hdd, /media. I can access this share fine in win2k, however I have no write permissions and no read permission beyond the top level directory (i.e. I can't go any further than opening the share). Here's what's in the smb.conf file:

[media]

comment = media
path = /media
printable = no
read only = no
public = yes
writable = yes

Any ideas? Also instead of going public = yes, can I restrict access with valid users = somehow to just allow the same username and password I use to logon to my win2k box? I have not been able to figure this out. I have been able to successfully share and read/write the /usr/local directory with valid users = root. However, all I want is read/write access to the /media share with the same user name I use to logon to the win2k box, or either a new custom user name, e.g. something like media1. Would I have to create a new user account on the linux box, or is there some other way to add users? Thanks in advance

swiftnet
07-27-2003, 11:17 PM
First off check, the permissions of the /media directory.

cd /
type in ls -la

this will show owner and permissions of all subdirectories under the /

You can change the ownership of the directory to just the one account.

I'll use the account name of mediauser

chown -Rf mediauser.mediauser /media

OK, now the media user account will have access to that directory.

You can change permissions to 0700 or 0750 or whatever you'd like.

edit the smb.conf file:

# public = yes
public = no
valid users = mediauser


Restart the samba service.

You did add the smbpasswd for the mediauser account, right?

smbpasswd -a mediauser

That should do it.

Floppyman
07-27-2003, 11:54 PM
Thanks for the reply, I got things working. Forgot to add the line that specifies the location of the smbpasword file into my smb.conf.

Say I want to add "mediauser", will I have to create a whole new linux account for it, or is there a way to just make a new username that SAMBA could use?

cowanrl
07-28-2003, 06:42 AM
mediauser will have to exist as a Linux user before you can create a Samba user with the same name.
However, if you just want to use the mediauser account for Samba access purposes, you do not have to give the Linux user mediauser the ability to log on to the system. That way the account can just be used to assign permissions to files and directories.

Floppyman
07-28-2003, 04:50 PM
Hi,

Thanks for the reply. How exactly would I setup the mediauser for Samba purposes only (i.e. so that user can't log on to the system)? Thanks!