LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Problems Writing to Samba Mount (https://www.linuxquestions.org/questions/linux-networking-3/problems-writing-to-samba-mount-38012/)

Jason_25 12-11-2002 01:46 PM

Problems Writing to Samba Mount
 
Ok I can now see the shares on my 2K machine by using this command:

mount -t smbfs -o username=Administrator,password=******
//win2k/pub /lan/win2k

I can see it as any user, however I cannot write to it as any user except root. I tried to change the ownership of the folder from root to my account "Jason", but whenever I remount the drive, the folder changes back to being owned by root.

My questions is: how can I write to this folder from my user account "Jason" without having to switch to root every time?

Thanks in advance.

Jason_25 12-12-2002 05:10 PM

Bump.

I'm kind of stumped here guys. The error (as reported from Nautilus) is "you do not have permissions to write to this folder"

Any help is appreciated.

plonker 12-12-2002 10:48 PM

I have a similar problem. The thing that I have found is that I cannot get access to the share via Nautilus even though I can browse it, but I can via the command line. Have you tried accessing via the CLI?

Cheers
Craig

Jason_25 12-13-2002 10:39 AM

Actually I can't write to it in the terminal or through Nautilus. I'm trying to figure out where the problem stems from. I'm guessing it's an ownership problem on the Linux box? If so, how do I change it to where the user "Jason" can write to it?

Jason_25 12-14-2002 03:13 PM

Well I guess I'll bump it up again. I find it hard to beleive that no one has run into this problem. It seems it would be very common but I could not find anything exactly like it through the search.

ajk 12-14-2002 05:07 PM

hi

I'm doing this by heart, so it can be incorrect.

a solution is to set the parameter UID of mount to the users UID. So you have to find out, what UserID you have and then something like
mount -t smbfs -o username=Administrator,password=******,UID=501
//win2k/pub /lan/win2k

please read man mount for correct use.
Else I'll bring up the right solution tomorrow... sorry for only a vague answer...

Adrian

ajk 12-15-2002 04:39 AM

ok it was almoust right :)

mount -t smbfs -o username=Administrator,password=******,uid=501
//win2k/pub /lan/win2k

if you are user number 501

Else, you could add a line in your fstab where you allow the user to mount himself... but then, you have to do this via sudo. Help required? ask.

Regards
Adrian

cinnabar 03-29-2004 06:52 AM

hi

I have a similar problem. Mounting a samba share via cli is no problem and I can also write in the mounted directory via cli.
But I cannot write in the directory using nautilus.
The samba share is mounted with a script containing the following line:

sudo mount -t smbfs -o username=myusername,password=foobar,uid=500,gid=100 //remotehost/home /home/dir

as the users has no root rights (exept the sudo right I created for).
As already said it's running using the cli but not with nautlius.

Do you have any idea concerning this problem?

Thanks for your help!

cinnabar 03-29-2004 06:57 AM

Additionaly the script is asking for the password, so the "foobar" is a variable. The solution with the fstab setting a plain text password is not eligible...

devfreak 03-29-2004 10:48 AM

cinnabar: I had this very problem. In fedora I could do limited things with my mounts, and if I was in root I could do whatever I wanted. I've got it fixed now, and here's my command, in your format:

sudo mount -t smbfs //Server/Share /home/me/mounts/folder -o username=me,password=password,fmask=777,dmask=777,rw

I put it in my home dir so I knew permissions weren't a problem and because it's easier access, the RW is key, and so is the fmask and dmask, these set the permissions. Also i see you are in group 100, I was in group 500 by default, but I wound up not using uid and gid because it worked fine without them!

even more to be sure of: make sure you are on the sudoers list, and that you don't require a password of yourself. If you don't run that script in a terminal and it wants a password it can't get it. My sudoers file was /etc/sudoers and my entry looks like this:

# User privilege specification
root ALL=(ALL) ALL
aaron ALL=(ALL) NOPASSWD: ALL


I think this is why you are being asked a password - not for the share, but for the sudo command.

cinnabar 03-30-2004 03:24 AM

devfreak : Thanks for responding. Unfortunately I have bad news. It doesn't work yet. I tried to mount the directory in my homefolder as you suggested.
But there is still the same error msg. when I try to copy a file to the mounted folder: "You do not have permissions to write to this folder." The rights of the folder are rwx for all.

In a second attempt I used the following cmd:

sudo mount -t smbfs //Server/Share /home/me/mounts/folder -o username=me,password=password,uid=500,gid=100,fmask=777,dmask=777,rw

as at first time owner and group of the folder were root.
Without success...

The /etc/sudoers list is correct I think and I already had the NOPASSWD tag. So the script is realy asking for users password and that's what I want... ;-)

JohnLinx 03-31-2004 02:09 PM

I have to chime in here. I am sure you have checked this, but it would cause a problem with write/create access to your Share. In the smb.conf file do you have READ ONLY = NO . If not then your access will be limited to RO, even though you have full rights on the Linux system. In another version of Samba it is coded as WRITEABLE = YES. Both of these enteries would be found in the [homes] section of the above mentioned config file.

Best of luck:cool:

devfreak 03-31-2004 03:33 PM

JohnLinx: I thought that was for local shares that have network access, not network shares to be accessed from the local machine?

cinnabar: Did you try mounting without specifying owner? I really don't need uid and gid in my own personal shares. I can't say taking mine out fixed anything, but it's been my experience that starting with bare minimum command and working your way towards more complexity is the key to finding you are saying too much.

cinnabar 04-01-2004 12:43 AM

@JohnLinx: The samba server is working fine. With other file manager it's working without any problems. It have to be a specific nautilus problem. Gnome and xnc, kde and konqueror and even with windows ;-) aren't any problems to write in the share. But unfortunately for this project nautilus would be required... :-(

@devfreak: Yes. First at all I tried to mount only with username and password and when this was failed I added uid and gid. I think I have tried almost all (access right) options in different combinations etc.

dworkin 04-09-2004 08:07 PM

I was unable to write to my samba share as well, actualy an app I am running that needs to write to it, I finaly fixed it by editing my "/etc/fstab" to look like this ...

//win_rig/D /mnt/win_rig/D smbfs users,username=me,password=mypass,fmask=777,dmask=777,rw 0 0

unmount and remount it with that in your fstab and all should be good. it worked for me using mandrake 9.1 anyway.

this seems obvious but could be overlooked... make sure the username and password your useing has full read write privilages set up on the windows share your trying to use.


All times are GMT -5. The time now is 04:22 AM.