LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 11-02-2007, 09:59 AM   #1
TKS
Member
 
Registered: Dec 2003
Location: NC, USA
Distribution: Slackware, VectorLinux, Smoothwall, and PCLinuxOS
Posts: 40

Rep: Reputation: 15
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?
 
Old 11-02-2007, 11:55 AM   #2
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
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.
 
Old 11-02-2007, 12:07 PM   #3
TKS
Member
 
Registered: Dec 2003
Location: NC, USA
Distribution: Slackware, VectorLinux, Smoothwall, and PCLinuxOS
Posts: 40

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by David1357 View Post
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
 
Old 11-02-2007, 02:23 PM   #4
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by TKS View Post
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 View Post
I'll attempt to get some dmesg info on this thread when I get back home to the PC
We look forward to getting more information so that we can help you more effectively.
 
Old 11-02-2007, 04:54 PM   #5
dave67
LQ Newbie
 
Registered: Apr 2007
Posts: 15

Rep: Reputation: 0
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.
 
Old 11-02-2007, 06:46 PM   #6
TKS
Member
 
Registered: Dec 2003
Location: NC, USA
Distribution: Slackware, VectorLinux, Smoothwall, and PCLinuxOS
Posts: 40

Original Poster
Rep: Reputation: 15
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.
 
Old 11-02-2007, 08:28 PM   #7
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
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.
 
Old 12-15-2007, 06:04 PM   #8
SPF
Member
 
Registered: Jul 2007
Location: /home
Distribution: Debian
Posts: 36

Rep: Reputation: 15
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.
 
Old 01-15-2008, 06:17 AM   #9
SPF
Member
 
Registered: Jul 2007
Location: /home
Distribution: Debian
Posts: 36

Rep: Reputation: 15
I found the solution:

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


Reply

Tags
chown, code, denied, gid, kernel, mount, root, smbfs, uid, user


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
samba client Access denied unable to connect Systest7 Linux - Networking 11 12-12-2010 08:45 PM
Samba PDC - XP client, Access is denied tstephens Linux - Networking 6 10-04-2007 12:59 AM
Access denied when attempting access samba share warlockvix Linux - Software 1 05-11-2007 02:36 PM
XP Client Returns 'Access is Denied' Error When Trying to Connect to a Samba Server BuckRogers01 Linux - Networking 1 05-25-2005 11:55 AM
access is denied : samba PDC, win2k client dkodegwc Linux - Networking 6 12-14-2002 11:02 AM


All times are GMT -5. The time now is 12:09 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration