LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Samba Client Access Denied (http://www.linuxquestions.org/questions/linux-software-2/samba-client-access-denied-596617/)

TKS 11-02-2007 10:59 AM

Samba Client Access Denied
 
I've got a box setup with samba and the security is share...this means that it is totally public on my internal LAN. I do this because I want anyone that connects to my LAN (I'm behind 3 firewalls) to be able to use my 1TB share full of music, movies, games, and other data.

In the past, this has worked quite well with a centralized samba server running CentOS. However, I've decommissioned the central samba server and moved the share to my main computer.

The thing is...I can connect, browse, and change files when dual booting into Windows...Windows sees the share and I can edit and change all files or copy new files into the share.

When I mount in Linux, I can see the share, read the share, but cannot write to the share despite having security = share set in the main box smb.conf. Windows recognizes this and allows changes. Linux does not.


I have my mount command in fstab so that it will automount the share at boot:

Code:

//hostname/share /mnt/share smbfs username=% 0 0
Now I've removed the username=% above and it still doesn't work. I refuse to input fmask, uid or dmask entries on the above line because this causes a large copy of files (say, 20 songs into an artists' folder) to prompt for each file with a dialog box telling the user that some attributes cannot be changed, etc.

So the question is...what is wrong here? It works no problems with Windows and has worked with Linux (on my previous server) in the past...why does it no longer work?

David1357 11-02-2007 12:55 PM

Re: Samba Client Access Denied
 
Can you mount the share using
# mount -tsmbfs //hostname/share /mnt/share
Does it prompt your for a username and password, or just the "Password:" prompt that you can ignore by hitting [Enter]?

If you can mount it using the above command, you will be able to look at the output of "dmesg" when you fail to write to the share, and it will give you extra information on what the problem is.

TKS 11-02-2007 01:07 PM

Quote:

Originally Posted by David1357 (Post 2945925)
Can you mount the share using
# mount -tsmbfs //hostname/share /mnt/share
Does it prompt your for a username and password, or just the "Password:" prompt that you can ignore by hitting [Enter]?

If you can mount it using the above command, you will be able to look at the output of "dmesg" when you fail to write to the share, and it will give you extra information on what the problem is.

Mounting the share isn't the problem...it mounts fine in Linux.

I have full read and browse access...I can't write to the share from Linux. Writing to the share with Windows works fine.

Both of those options require NO password when mounting because I have it setup that way on the samba server.

I'll attempt to get some dmesg info on this thread when I get back home to the PC :D

David1357 11-02-2007 03:23 PM

Quote:

Originally Posted by TKS (Post 2945941)
Mounting the share isn't the problem...it mounts fine in Linux.

I have full read and browse access...I can't write to the share from Linux. Writing to the share with Windows works fine.

Both of those options require NO password when mounting because I have it setup that way on the samba server.

All of that was very clear from your initial post. If you mount the share manually, you will get much more feedback on what is going on. That feedback will help us to help you.

Quote:

Originally Posted by TKS (Post 2945941)
I'll attempt to get some dmesg info on this thread when I get back home to the PC :D

We look forward to getting more information so that we can help you more effectively.

dave67 11-02-2007 05:54 PM

did you check the permissions on the folder to allow read and write I have a shared folder on samba server as well and I can read and write to it fine.

TKS 11-02-2007 07:46 PM

Got home, mounted the drive manually, checked dmesg. Here's the only thing in dmesg even closely resembling samba or mounts:

Code:

smb_proc_readdir_long: error=-2, breaking
That's it. Googling gives a lot of unanswered questions/forum posts/mailing list posts on this error.

David1357 11-02-2007 09:28 PM

Re: Samba Client Access Denied
 
That error code comes from the smbfs support in the kernel.

fs/smbfs/proc.c:

Code:

2385                req->rq_trans2_command = command;
2386                req->rq_ldata = 0;
2387                req->rq_data  = NULL;
2388                req->rq_lparm = 12 + mask_len + 1;
2389                req->rq_parm  = param;
2390                req->rq_flags = 0;
2391                result = smb_add_request(req);
2392                if (result < 0) {
2393                        PARANOIA("error=%d, breaking\n", result);
2394                        break;
2395                }

-2 means that it could not find a file or directory in the call to smb_add_request. Obviously, that is not a normal condition.

Basically, it either means you have a bug in the kernel, or a bug in the version of the samba utilities you are using, or you are using a version of the utilities that is not compatible with the kernel you are using.

From reading forum posts, it seems that the problem occurs when there are a lot of files in the directory (more than 512). How many files are in the directory on the share you are mounting? You said that this share has 1 TB of media files.
The easy things to do are

1. Upgrade your kernel

2. Upgrade your samba utilities

3. Upgrade both
I recommend trying option #1. Did you move the share from the CentOS machine to a Windows machine? If you moved it to a Linux machine with an older kernel, that might also be the problem.

SPF 12-15-2007 07:04 PM

root access only
 
Hi,

I have a similar problem. I can only mount the drive as root:
/mnt# ls -l
drwxr-xr-x 2 spf users 4096 2007-12-16 00:05 share
/mnt# mount //10.0.0.101/public /mnt/share
Password:
/mnt# ls -l
drwxr-xr-x 1 root root 4096 2007-12-16 00:41 share
/mnt# chown -R spf:users share
chown: changing ownership of `share': Operation not permitted
/mnt# umount /mnt/share
/mnt# mount -o username=spf //10.0.0.101/public /mnt/share
Password:
/mnt# ls -l
drwxr-xr-x 1 root root 4096 2007-12-16 00:41 share
/mnt# mount
...
...
//10.0.0.101/public on /mnt/share type smbfs (rw)
/mnt# umount /mnt/share
/mnt# su spf
/mnt$ mount //10.0.0.101/public /mnt/share
mount: only root can do that
/mnt$

Also making new directories as root is allowed, but change of ownership is not allowed.

I checked dmesg, but there are no error messages related to the mounts.

The network drive is a mass storage device which can be used by anyone. Under Windows it doesn't give any problems.

Originally, the drive only supports Windows and Mac.

SPF 01-15-2008 07:17 AM

I found the solution:

/mnt# mount -t smbfs -o uid=spf,gid=users,guest //10.0.0.101/public /mnt/share


All times are GMT -5. The time now is 06:44 PM.