Write from Windows to Samba shared Folder

My first go with OpenSuse, I’ve been a Windows man for years and had a go recently with Ubuntu. Suse is amazing! I’m blown away with the desktop, Yast is brilliant and the range of software is great.

I need to be able to write from a Windows rig to my new Suse machine so I followed the instructions here:

How To Network openSUSE 12.1 And Windows » TweakHound

I have two other Windows machines, 7 and XP and have the same problem on each: I can read the shared directory but not write to it. I’m really not sure about user permissions. Here’s my Samba config file:

*# smb.conf is the main Samba configuration file. You find a full commented

version at /usr/share/doc/packages/samba/examples/smb.conf.SUSE if the

samba-doc package is installed.

Date: 2011-11-02

[global]
workgroup = WORKGROUP
passdb backend = tdbsam
printing = cups
printcap name = cups
printcap cache time = 750
cups options = raw
map to guest = Bad User
include = /etc/samba/dhcp.conf
logon path = \%L\profiles.msprofile
logon home = \%L%U.9xprofile
logon drive = P:
usershare allow guests = Yes
add machine script = /usr/sbin/useradd -c Machine -d /var/lib/nobody -s /bin/false %m$
domain logons = No
domain master = No
netbios name = linux-xoe9
security = user
usershare max shares = 100
wins server =
wins support = No
[homes]
comment = Home Directories
valid users = %S, %D%w%S
browseable = No
read only = No
inherit acls = Yes
[profiles]
comment = Network Profiles Service
path = %H
read only = No
store dos attributes = Yes
create mask = 0600
directory mask = 0700
[users]
comment = All users
path = /home
read only = No
inherit acls = Yes
veto files = /aquota.user/groups/shares/
[groups]
comment = All groups
path = /home/groups
read only = No
inherit acls = Yes
[printers]
comment = All Printers
path = /var/tmp
printable = Yes
create mask = 0600
browseable = No
[print$]
comment = Printer Drivers
path = /var/lib/samba/drivers
write list = @ntadmin root
force group = ntadmin
create mask = 0664
directory mask = 0775

Share disabled by YaST

[netlogon]*

The folder I’m trying to share is my “Documents” folder.

I used Dolphin to change the permissions tab options to “Can view and modify Content”

On the Share tab I ticked “Share with Samba” and “Allow Guests”. In this tab my user name (dad) I gave “Full Control” but “Everyone” keeps defaulting back to “Read Only”

Thanks in anticipation.

Hi – welcome to the forums.

You are trying to use the Dolphin GUI to change the contents of smb.conf so that directory /home/dad/Documents is shared. Here’s a quick way: open smb.conf in a text editor and make the necessary changes direct to the file.

This command in a konsole window will open the file for editing (just like “notepad” does in windows):

kdesu kwrite /etc/samba/smb.conf

Then type (or copy/paste) this text at the bottom:

[Documents]
path = /home/dad/Documents
guest ok = yes
read only = no
force user = dad

Save and reboot and you should be good to go.

Oh, sorry, if you’re using openSUSE 12.1 there’s a bug to fix as well – here’s the discussion: http://forums.opensuse.org/english/get-technical-help-here/network-internet/468521-problem-samba-opensuse-12-1-re-systemd.html

In summary you have to remove the RPM sysvinit-init. You can do that in Yasy → software → software management → search → use the trem sysvinit-init. Delete it (and it will auto install systemd-sysvinit as well). That will fix the bug.

On Mon April 2 2012 08:16 am, Suseclues wrote:

>
> My first go with OpenSuse, I’ve been a Windows man for years and had a
> go recently with Ubuntu. Suse is amazing! I’m blown away with the
> desktop, Yast is brilliant and the range of software is great.
>
> I need to be able to write from a Windows rig to my new Suse machine so
> I followed the instructions here:
>
<snip>
> I have two other Windows machines, 7 and XP and have the same problem
> on each: I can read the shared directory but not write to it. I’m
> really not sure about user permissions. Here’s my Samba config file:
>
<snip>
>
> The folder I’m trying to share is my “Documents” folder.
>
> I used Dolphin to change the permissions tab options to “Can view and
> modify Content”
>
> On the Share tab I ticked “Share with Samba” and “Allow Guests”. In
> this tab my user name (dad) I gave “Full Control” but “Everyone” keeps
> defaulting back to “Read Only”
>
> Thanks in anticipation.
>
Suseclues;

I’m guessing that the Linux permission on your Documents directory does not
permit the “other users” to write. Samba must obey the Linux permissions.
When a user authenticates as guest on Samba they are identified as the Linux
user “nobody” and thus among the “other users”. As such the guest user will
not be able to write. One way around this is to give “other” write
permission:


su
chmod o+w <path to share>

Alternatively, you could use a traditional share and write your share
definition in /etc/samba/smb.conf. For example:


[YourShareName]
path = <full path to your share>
force user = Suseclues
read only = No
inherit acls = Yes
guest ok = yes

Here are a couple of references the second may help the most:
http://opensuse.swerdna.org/suselanprimer.html
and
http://opensuse.swerdna.org/susesambaserver.html

Just as an aside, I think you will be much happier if you change the name
resolve order in the [global] section of /etc/samba/smb.conf to:


name resolve order = bcast host lmhosts

The default order has broadcast (bcast) in last place and nmbd often gives up
before it finds the name. This will save you needing to know IP’s.


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

Thank you very much Swerdna and venzkep.

I followed Swerdna’s instructions with no success and venzkep’s with no success (I edited Swerdna’s additions to reflect venzkep’s), please see below:

# smb.conf is the main Samba configuration file. You find a full commented
# version at /usr/share/doc/packages/samba/examples/smb.conf.SUSE if the
# samba-doc package is installed.
# Date: 2011-11-02
[global]
	workgroup = WORKGROUP
	passdb backend = tdbsam
	printing = cups
	printcap name = cups
	printcap cache time = 750
	cups options = raw
	map to guest = Bad User
	include = /etc/samba/dhcp.conf
	logon path = \\%L\profiles\.msprofile
	logon home = \\%L\%U\.9xprofile
	logon drive = P:
	usershare allow guests = Yes
	add machine script = /usr/sbin/useradd  -c Machine -d /var/lib/nobody -s /bin/false %m$
	domain logons = No
	domain master = No
	netbios name = linux-xoe9
	security = user
	usershare max shares = 100
	wins server =
	wins support = No
	name resolve order = bcast host lmhosts
[homes]
	comment = Home Directories
	valid users = %S, %D%w%S
	browseable = No
	read only = No
	inherit acls = Yes
[profiles]
	comment = Network Profiles Service
	path = %H
	read only = No
	store dos attributes = Yes
	create mask = 0600
	directory mask = 0700
[users]
	comment = All users
	path = /home
	read only = No
	inherit acls = Yes
	veto files = /aquota.user/groups/shares/
[groups]
	comment = All groups
	path = /home/groups
	read only = No
	inherit acls = Yes
[printers]
	comment = All Printers
	path = /var/tmp
	printable = Yes
	create mask = 0600
	browseable = No
[print$]
	comment = Printer Drivers
	path = /var/lib/samba/drivers
	write list = @ntadmin root
	force group = ntadmin
	create mask = 0664
	directory mask = 0775
[Documents]
	path = /home/dad/Documents
	guest ok = yes
	read only = no
	force user = dad
	inherit acls = yes


## Share disabled by YaST
# [netlogon]

I am able to write from Windows by adding a Samba user the same as my main user id (dad) but then I can see and edit everything on my Suse machine

Your advice is appreciated. http://forums.opensuse.org/images/smiliesnew/smile.png

Sorry guys, half hour later with no reboots and it works!

Can you please recommend some reading for me on how Suse shares Users and groups? Windows can see:

Documents Which I expected and can now write to (thanks! :))

groups can’t access why is it shown?

profiles can’t access why is it shown?

users can’t access why is it shown?

Cheers

Groups are shown because of this [stanza] in smb.conf:

[groups]
	comment = All groups
	path = /home/groups
	read only = No
	inherit acls = Yes

It’s just a template. You can’t access it because the directory /home/groups doesn’t exist. You should delete the [groups] stanza.

Similarly [users] and [profiles] are special purpose templates that you should delete.

The stanza [homes] shares out the whole of the user’s (e.g. dad) home directory in a way that requires the remote user to enter smb://address, then username and password. Check the homes entry here: Samba and Suse: HowTo Set up an openSUSE-Windows Home Office LAN/Network. Versions 11.x. You might want to use it, or you might want to delete it.