LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Mandriva (https://www.linuxquestions.org/questions/mandriva-30/)
-   -   Permissions/group access when using Samba (https://www.linuxquestions.org/questions/mandriva-30/permissions-group-access-when-using-samba-177452/)

Nylix 05-03-2004 03:05 PM

Permissions/group access when using Samba
 
First off, I'm a newbie so I apologize up front if my question is simple (since I've been told that there's no such thing as a stupid question)...

I have Mandrake 10 running on an old machine on which I have installed Samba which performs the task of a fileserver. This in itself works great, but I'm somewhat lost when it comes to persmissions etc.

When I connect from another machine (also a Mandrake 10 host), I use an account which I have created on the Samba file server. This works fine but sometimes, I am unable to write files to the fileserver due to permissions. I then have to assign 777 permissions to the folder on the Samba host before I can copy anything onto it from the other machine...

question: When accessing a fileserver from another machine, which user account takes precedence - the Samba account which I use from the other machine or the current user account with which I am logged on on the machine I am copying from?

ps: When I am able to copy files across, it says that it was unable to change the permissions...

Thanks in advance!

robartes 05-03-2004 03:34 PM

Re: Permissions/group access when using Samba
 
Quote:

Originally posted by Nylix
First off, I'm a newbie so I apologize up front if my question is simple (since I've been told that there's no such thing as a stupid question)...

That's right - no stupid questions, just stupid answers :)


Quote:


question: When accessing a fileserver from another machine, which user account takes precedence - the Samba account which I use from the other machine or the current user account with which I am logged on on the machine I am copying from?

Samba normally accesses the filesystem with the user that authenticated to it, which should be a user on the file server itself (normally). To be able to write in a directory, a user needs rwx permissions on it, either as owner, as the group or as other. Since you have to set 777 permissions, I suspect that the user you are using is not the owner of the directory in question, and his primary group is not the group of the directory either. Check that first (ls -ld /path/to/directory).

Alternatively, you might have set up Samba to use guest access. If you think that's the case, post the relevant section of smb.conf and we'll see what we can do.

perry 05-03-2004 03:53 PM

Re: Permissions/group access when using Samba
 
Quote:

Originally posted by Nylix
First off, I'm a newbie so I apologize up front if my question is simple (since I've been told that there's no such thing as a stupid question)...

I have Mandrake 10 running on an old machine on which I have installed Samba which performs the task of a fileserver. This in itself works great, but I'm somewhat lost when it comes to persmissions etc.

When I connect from another machine (also a Mandrake 10 host), I use an account which I have created on the Samba file server. This works fine but sometimes, I am unable to write files to the fileserver due to permissions. I then have to assign 777 permissions to the folder on the Samba host before I can copy anything onto it from the other machine...

question: When accessing a fileserver from another machine, which user account takes precedence - the Samba account which I use from the other machine or the current user account with which I am logged on on the machine I am copying from?

ps: When I am able to copy files across, it says that it was unable to change the permissions...

Thanks in advance!

and the answer is, try to use NFS....

Samba is a bitch, Oh and if you do manage to get it working... DO NOT and repeat DO NOT try to update it....

it'll never work again.....

- perry

Nylix 05-03-2004 04:04 PM

Ha! Thank you for the good tip - it's silly how one overlooks the obvious when it's right under your nose!

I have managed to sort this out a little bit further... I am now stuck at the following point:

When I try to copy a folder that includes some MP3 files to the fileserver, the folder is created on the fileserver but an error pops up that I do not have the permissions to write to the folder.

When I look at the 'ls -l' listing of the folder, it shows the following: drwxr-xr-r. The user is the owner of the directory and also belongs to the group (which is coincidentally the same name as the username). Do I also have to add write permissions for the group, i.o.w. drwxrwxr-x ?

Thanks for the help so far!!!

>>Edit: the thanks for the tip I mentioned refers to the previous comment - not the NFS comment!! I have not looked at NFS yet - but any advice would be good though...

pgmer6809 05-03-2004 04:58 PM

Samba vs NFS
 
Unix was doing file sharing long before windows or Novell.
The way Unix did this was (and is)via NFS. NFS therefore is nicely integrated into Unix (and hence Linux). In techie terms it uses Unix file semantics. It thinks about permissions and users the same way that Unix does.
Samba is designed to allow Windows to Unix (and vice versa) filesharing. As such it has to try to make windows look like unix and unix look like windows.

If you are running a Unix (Linux) only network, you don't really need the extra complexity of Samba. You can just use NFS.

One warning though: NEVER NEVER NEVER do a 'hard' NFS mount as part of your boot up sequence. If the other machine is not available, or the network is down, your boot sequence will not complete,and your machine will hang.
If you must mount NFS drives at boot time, then do a 'soft' NFS mount. It will time out (slowly!!) if it does not succeed and at least your machine will finish its boot up.

Nylix 05-04-2004 12:29 AM

Mmmmm, I do have some Windows hosts in my network though - would it still be possible to use NFS for Windows? Another possibility might be to install additional network components for the Windows Hosts which will allow for it to communicate with a NFS machine...

Any possible solutions are welcome! Could anyone possibly direct me to some good sites where I can get some information on NFS and also the installation/configuration of it?

robartes 05-04-2004 02:44 AM

Quote:

Originally posted by Nylix
When I try to copy a folder that includes some MP3 files to the fileserver, the folder is created on the fileserver but an error pops up that I do not have the permissions to write to the folder.
When I look at the 'ls -l' listing of the folder, it shows the following: drwxr-xr-r. The user is the owner of the directory and also belongs to the group (which is coincidentally the same name as the username). Do I also have to add write permissions for the group, i.o.w. drwxrwxr-x ?

Hmm, than the user that Samba is using is not the user we think it's using. If you set the directory permissions to 777, and copy the mp3 files into it, who is the owner of the files? That is the user samba is using.

Dave Farrance 05-04-2004 03:01 AM

Samba's nmb and smb logfiles, usually somewhere in the /var/log tree, are very useful for telling you why something has been refused.

You can set the amount of information tht goes to the logfiles in the samba config file. I don't know if you can do that from Samba's GUI manager, because I've never used it.

Nylix 05-05-2004 03:39 PM

Thanks for all the handy tips!! I'll have a look and see whether I can figure this problem out! You've definitely helped me in he right direction!!

: ))


All times are GMT -5. The time now is 03:11 PM.