Permissions on Samba shares?

I am running an old P4 box with openSUSE 11.0 as a Samba/print server. It’s been working beautifully, with one exception. While Windows (and Mac) machines can read and write files with no problems, but neither of my openSUSE machines can. When I try to copy over a file to the share, I get a “permission denied” message. I want the files to be opened to everybody, so I ran chmod -Rv o+rw [share] on it, but it still won’t let me put files on it (though I can read them without a problem).

Any ideas?

On Fri February 6 2009 08:56 pm, zak89 wrote:

>
> I am running an old P4 box with openSUSE 11.0 as a Samba/print server.
> It’s been working beautifully, with one exception. While Windows (and
> Mac) machines can read and write files with no problems, but neither of
> my openSUSE machines can. When I try to copy over a file to the share, I
> get a “permission denied” message. I want the files to be opened to
> everybody, so I ran chmod -Rv o+rw [share] on it, but it still won’t let
> me put files on it (though I can read them without a problem).
>
> Any ideas?
>
>
zak89;

Can you post the contents of /etc/samba/smb.conf. Both the GLOBAL and the
share section ( for the share in question)? How are you trying to access the
share from the opensuse machine? If you are using mount.cifs, it may be a
permission problem on the mount point or the mount command, in this case it
would not harm to post the mount command you use.

Of course when you post, use place holders for any critical information such
as public IP’s or passwords.

P. V.
“We’re all in this together, I’m pulling for you.” Red Green

Try making it writeable to group too with g+rw as well (better yet, 777). Then if that doesn’t work, copy the stanza for the share from smb.conf to here so we can check it out.

Edit – just notice PV’s post, so cancel my smb.conf request and go with: chmod 777 and PV’s smb.conf

Okay, I "chmod 777"ed the whole share, and I can now copy easily over the terminal, but I get a “cannot change permissions” message from Dolphin. The file is still copied over, however. What is Dolphin complaining about?

This is the global entry:

[global]
        workgroup = KLEINET
        netbios name = dell531
        name resolve order = bcast host lmhosts wins    printing = cups
        printing = cups
        printcap name = cups
        printcap cache time = 750
        cups options = raw
        load printers = yes
        use client driver = yes
        map to guest = Bad User
        include = /etc/samba/dhcp.conf
        local master = yes
        os level = 33
#       logon path = \\%L\profiles\.msprofile
#       logon home = \\%L\%U\.9xprofile
#       logon drive = P:
        usershare allow guests = Yes

And here’s the Samba share’s entry:

[SharedMedia]
        path = /srv/ftp/
        guest ok = yes
        read only = no

Hmm, this seems to be Dolphin specific. Konqueror copies the files without any message. So I guess this may be something for a bug report, rather than a forum topic. It seems that I can now copy files to and from the share like I wanted. Thanks!

Spoke too soon. I still get a “Access Denied. Could not write to [share name]/file_i_am_copying” message.

Anything look amiss in my smb.conf?

Hi
You might change this:
name resolve order = bcast host lmhosts wins printing = cups
to this:
name resolve order = bcast host lmhosts wins
BUT that’s got nothing to do with your problem.

There’s nothing wrong with your smb.conf. It’s set to create files in the name of user=nobody, group=nobody (believe it or not, a genuine Linux user and group). And those files are writeable over the network by an attaching Samba guest user because the guest attaches as nobody:nobody and can write to the files as such, even thought the directory is owned by root:root.

BUT if you move files into the directory “ftp” that are owned otherwise than by nobody:nobody; for example owned by root:root, the Linux owner of the directory, you will have problems coming in from the network as a guest. Trying to modify those files over the network will generate this sort of message:
access denied: could not write to share_name/file_name

This is similar to yours but slightly different. Your is suggestive of trying to place files in a subdirectory of the main directory, e.g. into a directory like /srv/ftp/other_directory.

OR it could be a problem with Dolphin in KDE4.0 in openSUSE 11.0, which was at the least quite dodgy.

So, are you trying to write over the network into a subdirectory of the directory “ftp” or not?

Hmm. I think that the ownership problem was it. To get around that, I created a new directory (/srv/media) set it’s ownership to nobody:nobody, changed my smb.conf line to

[SharedMedia]
        path = /srv/media/
        guest ok = yes
        read only = no

And then ran rcnmb restart && rcsmb restart to reload my Samba config. However, now I cannot mount the share like I used to:

mount -t cifs -o username=klein,password=klein //192.168.1.70/SharedMedia /home/zak89/SharedMedia/

mount error(5): Input/output error. Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)

What did I do wrong?

OK, new ingredient: the cifs mount. I suggest you get the admininistrative aspects of the mount a bit more normal. Put everything in the name of some more ordinary Linux user for sake of improved functionality. Suppose you have a normal Linux user on the server called billybob.

Make the directory and its contents over to billybob and make the permissions more like normal Linux permissions. I suggest “share #4” on this reference:
Samba Server and Suse / openSUSE: HowTo Configure a Professional File Server on a SOHO LAN
The permissions: sudo chmod -R 750 /srv/media
The ownership: sudo chown -Rf billybob:users /srv/media
The Samba user database: bilkllbob doesn’t have to be a member of the samba user database
The stanza for the share:
[SharedMedia]
path = /srv/media/
guest ok = yes
read only = no
force user = billybob
The cifs mount command that you issue from the client machine:
mount -t cifs -o password= //192.168.1.70/SharedMedia /home/zak89/SharedMedia/
Note: No username because you have guest access. Supply a null password (password=)

Make sure “map to guest = Bad User” is in the [global] stanza

Okay, that seemed to mount everything.

Sure enough, now I can copy files without a problem. Thanks a lot! Now I just got to get this to mount a boot time.

To mount it at boot time I suggest you add this line to fstab, at the bottom, being sure to leave a blank line as the last line:
//192.168.1.70/SharedMedia /home/zak89/SharedMedia/ cifs password=,_netdev,nobrl 0 0

For more info: Samba: HowTo Mount a CIFS Network Share [AKA Map Network Drive] in openSUSE 10 & 11 plus FAQs

Thank you, sir!

Glad to help

I have a similar issue, I get the cannopt change permissions when copying file sin Konqueror and Dolphin, I can create a text file and editi it in KDE based apps, but if I create a new OpenOffice document or edit a doc in OpenOffice it opens Read Only. I cant save ino this drive, it returns permissions denied.

My Server is Open Suse 10.1, sharing a public folder via SAMBA,
I have a Windows Vista client mapping to this OK
I have an OS X 10.5 client maping drives to this share OK
I have an Ubuntu 8.04 client mounting this share fine using fusesmb.
The only one I have problems with is the OpenSuse desktop. It used to work fine mounting this share using SMB4K under Suse10.0.
SMB4K does not seem to run correctly in 11.1, missing paths to nmblookup, smbclient,smbspool, net, even though the required SMBClient packages appear to be installed OK.

My mount command is as follows:
mount -t cifs //venus/shareddata /home/howellj/network/shareddata

Folders on the server are owned by nobody:nobody, permissions on the files and folders are -rwxrw-rw-.

Not sure if this will help, but try it and see:
mount -t cifs -o nobrl //venus/shareddata /home/howellj/network/shareddata