LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 03-02-2003, 03:31 PM   #1
Neuronet
Member
 
Registered: Feb 2003
Location: The Netherlands
Distribution: Debian 3.0
Posts: 43

Rep: Reputation: 15
Can only write to samba shares as root.


My problem is that I am only able to write to samba shares as root (i.e. the drives on my windows box that are being shared). I've tried chmod-ing both the mount directory and the share itself (after mounting), to rwxrwxrwx. When I change the permissions for the mount directory it goes well and the permissions are set accordingly but doesn't get me read or write access to the share. When I mount the share the access drops to rwx-r-xr-x. When I tried chmod-ing the share, although the chmod command doesn't complain of an error, the modifications do not take place.

Does anybody have any idea how I can resolve this

While I'm here I may as well mention, my attempts to get the share into fstab have been unsuccessful. I have added ...

//Nova/d /mnt/D smb username=user,password=pass 0 0

to my fstab but it complains that the line isn't valid when the system boots. Not the most revealing of errors. It mounts fine with the line...
mount -t smb //Nova/d /mnt/D -o password=pass

Thanks to anyone who has the time and inclination to reply.

Neuronet.
 
Old 03-02-2003, 03:45 PM   #2
joesbox
Member
 
Registered: Feb 2003
Location: hampton va
Distribution: ubuntu
Posts: 502

Rep: Reputation: 30
your problem is with your fs designator. use smbfs instead of smb. try this line

//Nova/d /mnt/D smbfs username=user,password=pass,uid=<username on linux>,gid=<groupname on linux coinsiding with *nix user> 0 0

this will say that you are the owner of the folder. one other thing you may try, mount the win to a folder under /home/<user>/samba_mount. this is what i do for ease and accessibility. just some ideas.


==========
edit
==========
almost forgot about the "rw" at the end. that will give read/write permissions to you.
here is mine
//WINXP-BOX/WINXPSHARE /home/joe/xpdrive smbfs username=!JOE,password=<**********>,uid=joe,gid=joe,rw 0 0

<**********> is replaced by my winxp password that i am not going to put on the net. it coincides with the username <!JOE>.

Last edited by joesbox; 03-02-2003 at 03:57 PM.
 
Old 03-03-2003, 05:30 AM   #3
Neuronet
Member
 
Registered: Feb 2003
Location: The Netherlands
Distribution: Debian 3.0
Posts: 43

Original Poster
Rep: Reputation: 15
Hey thanks for that :-)

Hey thanks for that :-)

It got my share mounted by fstab.

Just one more question.

That allows me to write to the share as the user I specify, but not the other members of the same user-group. Is there any way I can add other users to that, or preferably a group.

I tried specifying just the group (gid=vanilla) but that didn't work, so I think I can safely presume that's because the permissions are rwxr-xr-x, so only the user can write.

I can't seem to change the persmissions to rwxrwxr-x with charmod though.

Again, thanks for your time & energy :-)

Neuronet

Last edited by Neuronet; 03-03-2003 at 07:02 AM.
 
Old 03-03-2003, 01:33 PM   #4
joesbox
Member
 
Registered: Feb 2003
Location: hampton va
Distribution: ubuntu
Posts: 502

Rep: Reputation: 30
try taking out the uid and gid and replacing them with something similar to the other mounts on the fstab. it may look like:

//Nova/d /mnt/D smbfs username=user,password=pass,users,rw 0 0

give this a try.
 
Old 03-03-2003, 02:49 PM   #5
Neuronet
Member
 
Registered: Feb 2003
Location: The Netherlands
Distribution: Debian 3.0
Posts: 43

Original Poster
Rep: Reputation: 15
When I tried that the user went back to root and I could only write to the share as root again.
with the entry...
//Nova/d /mnt/D smbfs username=user,password=pass,user,rw 0 0

Thanks :-)
 
Old 03-03-2003, 07:25 PM   #6
joesbox
Member
 
Registered: Feb 2003
Location: hampton va
Distribution: ubuntu
Posts: 502

Rep: Reputation: 30
maybe you can creat several mounts. one for each user with their own access. meaning put the mount under "/home/<user>/mount_folder" for each user. and make an fstab entry for each user. understand?? kool.
 
Old 03-03-2003, 09:59 PM   #7
figadiablo
Member
 
Registered: Feb 2002
Location: Virginia USA
Distribution: Slackware, CentOS, Fedora
Posts: 342

Rep: Reputation: 30
Neuronet, I've been having the same problems for a couple of days now. But tonite, after doing some more indepth research (google.com/linux) I hit gold. it all involves setting the fmask and dmask settings ( just like the umask if it was a vfat partition you were mounting).

This is what my fstab line looks like now:

//figax/D /mnt/smb/figax/D smbfs username=administrator,password=,fmask=0777,dmask=0777,rw 0 0

Now I can write and delete with both of my regular users.

Hope this helps.
Figa
 
Old 03-04-2003, 11:40 AM   #8
Neuronet
Member
 
Registered: Feb 2003
Location: The Netherlands
Distribution: Debian 3.0
Posts: 43

Original Poster
Rep: Reputation: 15
Hoorah!

Thanks folks, it's going!

just fyi...

I made the owner group = vanilla (my plain users) and user fmask=0775,dmask=0775 to set the group write permissions on.

Thanks for the help folks :-)

Neuronet
 
Old 03-04-2003, 12:20 PM   #9
figadiablo
Member
 
Registered: Feb 2002
Location: Virginia USA
Distribution: Slackware, CentOS, Fedora
Posts: 342

Rep: Reputation: 30
Is anybody here able to mount shares as a nonroot user. Like for example, if I use LineNeighborhood to browse the network, and then I try to mount a share in my own directory, LineNeighborhood wil complain with the following error:

"smbmnt must be installed suid root for direct user mounts (1000,1000)
smbmnt failed: 1"

Any ideas. I've been searching for a solution to this for quite a while. Now that I know how to mount shares (as root) so that anyone can read and write to them, it would be nice to be able to mount them as a user in my own directory too.

Cheers,
Figa
 
Old 03-04-2003, 12:53 PM   #10
joesbox
Member
 
Registered: Feb 2003
Location: hampton va
Distribution: ubuntu
Posts: 502

Rep: Reputation: 30
!

Last edited by joesbox; 03-04-2003 at 12:55 PM.
 
Old 03-06-2003, 03:36 AM   #11
Neuronet
Member
 
Registered: Feb 2003
Location: The Netherlands
Distribution: Debian 3.0
Posts: 43

Original Poster
Rep: Reputation: 15
You would need to do two things to make the drive mountable by a user.

1. make the directory /mnt/smbshare world writable
(where /mnt/smbshare is the directory that you want to mount to) with chmod 777 /mnt/smbshare
2. edit the fstab to make the device writable to users and also mountable.

your fstab entry needs to have the following...

//Winbox/Share /mnt/smbshare smbfs password=pass,gid=groupname,fmask=0777,dmask=0777,rw,user 0 0

The bits of importance are the fmask & dmask parts (to make sure the share is accessable to plain users - as described above) and the user part to make sure the drive is user mountable.

That's from what I understand. I've done it with other drives but never a share, though I see no reason why it wouldn't work.

Hope that helps,

Neuronet.
 
Old 03-07-2003, 11:01 PM   #12
figadiablo
Member
 
Registered: Feb 2002
Location: Virginia USA
Distribution: Slackware, CentOS, Fedora
Posts: 342

Rep: Reputation: 30
Quote:
Is anybody here able to mount shares as a nonroot user. Like for example, if I use LineNeighborhood to browse the network, and then I try to mount a share in my own directory, LineNeighborhood wil complain with the following error:

"smbmnt must be installed suid root for direct user mounts (1000,1000)
smbmnt failed: 1"
, finally, after days of breaking my head, trying to do this, I was able to fire up LineNeighborhood as a regular user and mount network shares in my own folder. Now I don't need to become root, or neither do I have to type it in in fstab. Well, for those who might be interested, as root type in these commands:

chmod u+s /usr/bin/smbmnt
chmod u+s /usr/bin/smbumount

these to will enable the users to mount and umount the shares to their respective drives.

Thought this might be interesting,
Figa
 
Old 06-25-2003, 04:49 AM   #13
tH3_M0nk
LQ Newbie
 
Registered: Jun 2003
Location: San Diego, CA
Distribution: RedHat 9
Posts: 5

Rep: Reputation: 0
Quote:
Originally posted by figadiablo
, finally, after days of breaking my head, trying to do this, I was able to fire up LineNeighborhood as a regular user and mount network shares in my own folder. Now I don't need to become root, or neither do I have to type it in in fstab. Well, for those who might be interested, as root type in these commands:

chmod u+s /usr/bin/smbmnt
chmod u+s /usr/bin/smbumount

these to will enable the users to mount and umount the shares to their respective drives.

Thought this might be interesting,
Figa
Everytime I've tried to do that (chmod u+s), smbmount complains that smbmount MUST NOT be setuid root. Any other suggestions?
 
Old 06-25-2003, 11:19 AM   #14
figadiablo
Member
 
Registered: Feb 2002
Location: Virginia USA
Distribution: Slackware, CentOS, Fedora
Posts: 342

Rep: Reputation: 30
is it smbmount or smbmnt???


Figa
 
Old 06-25-2003, 11:58 PM   #15
tH3_M0nk
LQ Newbie
 
Registered: Jun 2003
Location: San Diego, CA
Distribution: RedHat 9
Posts: 5

Rep: Reputation: 0
Aren't they virtually the same? I tried it on smbmount/smbumount not smbmnt.
 
  


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
Unable to write to Samba Shares. usaf_sp Linux - Software 1 11-02-2005 01:45 PM
Windows ME cannot write to SAMBA shares apostate Linux - Software 2 07-30-2005 10:56 PM
non root samba write permission Lazarus Linux - Software 8 05-29-2005 04:57 AM
Can not write to Samba Linux Shares from Windows boyd98 Linux - Software 2 05-12-2005 05:51 PM
Cannot create, modify, or write to Samba shares mpriddy Linux - Software 4 02-18-2004 10:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:43 AM.

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