LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 01-31-2011, 10:19 AM   #1
android-eve
Member
 
Registered: Dec 2010
Posts: 36

Rep: Reputation: 1
Question Can't read/write my mounted smbfs share


I am trying to smbmount a Samba share to be used on my Ubuntu 10.04 desktop.

I created a mount point
Code:
sudo mkdir /mnt/smb-sambaserv-myshare
and added the following to my fstab:
Code:
//sambaserv/myshare /mnt/smb-sambaserv-myshare cifs credentials=/home/androideve/.smbcredentials,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0
I of course added the right credentials to /home/androideve/.smbcredentials and it mounts well but...

I can't really read and write to the folders inside the share.

What am I doing wrong?
 
Old 01-31-2011, 10:55 AM   #2
ozanbaba
Member
 
Registered: May 2003
Location: İzmir
Distribution: Slackware64 15.0 Multilib
Posts: 778

Rep: Reputation: 135Reputation: 135
try umask=0000 instead of file_mode and dir_mode. You can try using uid and guid as well.
 
Old 01-31-2011, 07:25 PM   #3
android-eve
Member
 
Registered: Dec 2010
Posts: 36

Original Poster
Rep: Reputation: 1
Question

Quote:
Originally Posted by ozanbaba View Post
try umask=0000 instead of file_mode and dir_mode.
I tried. It, of course, didn't work. It has to do with the fact that /etc/fstab entries are mounted by root, while I am logged in as androideve. How do I work around that?
 
Old 01-31-2011, 07:51 PM   #4
android-eve
Member
 
Registered: Dec 2010
Posts: 36

Original Poster
Rep: Reputation: 1
Question

Quote:
Originally Posted by ozanbaba View Post
You can try using uid and guid as well.
On the other hand, setting uid and guid in /etc/fstab per the mount.cifs man page, finally allowed me to start seeing what's in the share.

The only problem is that I need to do "sudo mount" instead of just "mount". Is there a way to work around that?
 
Old 02-01-2011, 03:06 AM   #5
ozanbaba
Member
 
Registered: May 2003
Location: İzmir
Distribution: Slackware64 15.0 Multilib
Posts: 778

Rep: Reputation: 135Reputation: 135
Quote:
Originally Posted by android-eve View Post
On the other hand, setting uid and guid in /etc/fstab per the mount.cifs man page, finally allowed me to start seeing what's in the share.

The only problem is that I need to do "sudo mount" instead of just "mount". Is there a way to work around that?
user option in fstab, It allows user to mount the entries.
 
Old 02-01-2011, 09:27 AM   #6
android-eve
Member
 
Registered: Dec 2010
Posts: 36

Original Poster
Rep: Reputation: 1
Question

Quote:
Originally Posted by ozanbaba View Post
user option in fstab, It allows user to mount the entries.
Thanks. That indeed allows executing that entry in /etc/fstab but now I get a new error:
Code:
mount error: permission denied or not superuser and mount.cifs not installed SUI
This is despite the fact that I took care of the SUID by doing:
Code:
sudo chmod +s /usr/bin/smbmount
sudo chmod +s /usr/bin/smbumount
sudo chmod +s /sbin/mount.cifs
sudo chmod +s /sbin/umount.cifs
What do I do to finally make this work?
 
Old 02-01-2011, 09:40 AM   #7
ozanbaba
Member
 
Registered: May 2003
Location: İzmir
Distribution: Slackware64 15.0 Multilib
Posts: 778

Rep: Reputation: 135Reputation: 135
how about mount ?
 
Old 02-01-2011, 09:57 AM   #8
android-eve
Member
 
Registered: Dec 2010
Posts: 36

Original Poster
Rep: Reputation: 1
Question

Quote:
Originally Posted by ozanbaba View Post
how about mount ?
I just did that, too:
Code:
sudo chmod +s `which mount`
ls -la `which mount`
-rwsr-sr-x 1 root root 82256 2011-01-20 14:56 /bin/mount
But I still get this error:
Code:
mount error: permission denied or not superuser and mount.cifs not installed SUID
Why is so difficult to make smbfs/CIFS usable on Ubuntu 10? (root-only mount is NOT useful to me, because the shares on my Samba server are not exported as 'root').

What do I do now?
 
Old 02-01-2011, 10:02 AM   #9
ozanbaba
Member
 
Registered: May 2003
Location: İzmir
Distribution: Slackware64 15.0 Multilib
Posts: 778

Rep: Reputation: 135Reputation: 135
Thinkg is only mount should have SUID. Rest of the commands are run by mount as root. (That's reason mount is in /bin/mount while mount.* is in /sbin)
 
Old 02-01-2011, 05:50 PM   #10
android-eve
Member
 
Registered: Dec 2010
Posts: 36

Original Poster
Rep: Reputation: 1
Exclamation

Well, I made some progress by trying:
Code:
mount.cifs //sambaserv/myshare /mnt/smb-sambaserv-myshare -o setuids -user=remoteuser
and it mounted, magically making the local desktop user the owner of that entire mount (including newly created files), while at the same time those newly created files have the remote user as their owner on the remote system! It looks very promising but it doesn't work yet because if I try to edit a newly such created file, the local system says:
Quote:
Could not open the file... You do not have the permissions necessary to open the file.
This is weird since it's -rw- on both systems for both usernames!

On the remote server (when I SSH to it) I see:
Code:
/home/share/workspace> ls -la empt*
-rw-rw----  1 remoteuser remoteuser 9 Feb  1 18:50 empty-file.txt
On the local system (with that share mounted) I see:
Code:
androideve@desktop:/mnt/smb-sambaserv-myshare/workspace$ ls -la empt*
-rw-rw---- 1 androideve androideve 9 2011-02-01 18:50 empty-file.txt
Yet, there is no way I can locally open empty-file.txt for either read or write!

This drives me crazy...

Why is this happening and how do I nail it once and for all?

Last edited by android-eve; 02-01-2011 at 05:54 PM. Reason: typo
 
Old 02-01-2011, 08:45 PM   #11
android-eve
Member
 
Registered: Dec 2010
Posts: 36

Original Poster
Rep: Reputation: 1
Question

Update: I went through the whole ordeal of creating another user with the same uid/gid as the one on the remote server, just to experience the same problem. This time I had no choice, I had to find an explanation for this weird "permission denied" error. So I looked at /var/log. Sure enough, kern.log shows:
Code:
Status code returned 0xc0000022 NT_STATUS_ACCESS_DENIED
 CIFS VFS: Send error in read = -13.
This helped me find a description of the same exact problem here:
http://www.fedoraforum.org/forum/showthread.php?t=100193


And... this is the explanation for the mystery: http://www.fedoraforum.org/forum/sho...1&postcount=26

Last edited by android-eve; 02-01-2011 at 08:54 PM. Reason: Update
 
Old 02-02-2011, 02:21 AM   #12
ozanbaba
Member
 
Registered: May 2003
Location: İzmir
Distribution: Slackware64 15.0 Multilib
Posts: 778

Rep: Reputation: 135Reputation: 135
Quote:
Originally Posted by android-eve View Post
Code:
Status code returned 0xc0000022 NT_STATUS_ACCESS_DENIED
 CIFS VFS: Send error in read = -13.
If everything looks okay with permissions, then check out the server configurations
 
  


Reply



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
[SOLVED] NFS share is mounted as read-only even if write permissions are set vofka Linux - Server 2 04-14-2010 06:09 PM
root unable to write on drive mounted with read/write perrmission aquash2000 Linux - Server 5 07-19-2008 12:20 PM
Mounted read-write Fat32 partition suddenly becomes read-only?? hohead Linux - General 8 04-05-2007 12:17 PM
mounting SMBFS as read and write. n1wil Linux - Networking 4 08-24-2002 03:28 PM
Fs mounted in Read Only , Read Write Mode benjaminrtz Linux - General 2 07-31-2002 02:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration