Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
darioOffline
Post subject: Issue sharing a folder inside the home directory with Samba  PostPosted: 27.11.2010, 21:10



Joined: 2010-11-27
Posts: 63

Status: Offline
Hi! I have an issue when I attempt to share a folder using the "share" tab in the folder properties. The configuration is this: the radio button is set to "shared", I also selected the "writable" option for the folder in "configure file sharing".
With this configuration i can see the folder from a Windows machine but i can't open it, getting the error 0x80070035, network path not found.
The strange thing is that if I share a folder outside my home directory adding this to smb.conf:
      Code:

[shared]
path = /home/public/
comment = Condivisa
guest ok = yes
read only = no

the share works perfectly and i can browse the folder from the windows machine.
Does someone know why sharing a folder inside my home doesn't work?
I'm sorry if my english isn't very good, I'm a little out of training
 
 View user's profile Send private message  
Reply with quote Back to top
muchan
Post subject: Re: Issue sharing a folder inside the home directory with Sa  PostPosted: 27.11.2010, 22:13
Moderator


Joined: 2010-09-11
Posts: 468

I don't understand the part:
      Quote:
attempt to share a folder using the "share" tab in the folder properties. The configuration is this: the radio button is set to "shared", I also selected the "writable" option for the folder in "configure file sharing".


what program are you using for configuration?

why don't you just add the entry in smbconf just like your /home/public case? (+ give the permission to access the folder for visiting smb client, using chmod)
 
 View user's profile Send private message  
Reply with quote Back to top
darioOffline
Post subject:   PostPosted: 28.11.2010, 00:33



Joined: 2010-11-27
Posts: 63

Status: Offline
Thanks for the reply, I simply use the kde graphic way to share a folder (right click on the folder icon->properties->"share" tab->"shared" radio button + writable in "configure file sharing"). I forgot to say that I have installed kdenetwork-filesharing to enable this functionality.
This is my complete smb.conf, the "CONDIVISIONE" entry has been generated by the procedure above:
      Code:


[global]
security = share

[shared]
path = /home/public/
comment = Condivisa
guest ok = yes
read only = no

[CONDIVISIONE]
path = /home/dario/condivisione/
comment = /home/dario/condivisione
guest ok = yes
read only = no
wide links = no

I don't see great differences between the entries (except wide links) but the second doesn't work.
The permission of /home/dario/condivisione were set with:
chmod -R +777 condivisione/ (from /home/dario obviously)
There isn't a special motivation, it's only because it's faster to do this in a graphic way, and because this is the only thing that doesn't work for me in this fantastic distro!
 
 View user's profile Send private message  
Reply with quote Back to top
muchan
Post subject:   PostPosted: 28.11.2010, 01:30
Moderator


Joined: 2010-09-11
Posts: 468

you should recheck the permissions with "ls -l" command. Smile

It's first time for me to see "+777" for chmod. Smile I mean, '+' is used with number 777.
I checked the "man chmod", here's the quote:
      Quote:
The operator + causes the selected *file mode* bits to be added to the
existing file mode bits of each file; - causes them to be removed; and
= causes them to be added and causes unmentioned bits to be removed
except that a directory's unmentioned set user and group ID bits are
not affected.

The letters rwxXst select *file mode* bits for the affected users: read
(r), write (w), execute (or search for directories) (x), execute/search
only if the file is a directory or already has execute permission for
some user (X), set user or group ID on execution (s), restricted dele‐
tion flag or sticky bit (t). Instead of one or more of these letters,
you can specify exactly one of the letters ugo: the permissions granted
to the user who owns the file (u), the permissions granted to other
users who are members of the file's group (g), and the permissions
granted to users that are in neither of the two preceding categories
(o).

A *numeric mode* is from one to four octal digits (0-7), derived by
adding up the bits with values 4, 2, and 1. Omitted digits are assumed
to be leading zeros. The first digit selects the set user ID (4) and
set group ID (2) and restricted deletion or sticky (1) attributes. The
second digit selects permissions for the user who owns the file: read
(4), write (2), and execute (1); the third selects permissions for
other users in the file's group, with the same values; and the fourth
for other users not in the file's group, with the same values.


(*enphasis* is by me)

So. +777 is invalid option. + and - are applied only on rwxXst.
So the permission was not changed.


Last edited by muchan on 28.11.2010, 13:30; edited 1 time in total
 
 View user's profile Send private message  
Reply with quote Back to top
darioOffline
Post subject:   PostPosted: 28.11.2010, 10:49



Joined: 2010-11-27
Posts: 63

Status: Offline
Sorry, the the command line I used was this:
      Code:

chmod -R 777 condivisione/

with no +. These are the permissions of the folder:
      Code:

drwxrwxrwx   2 dario dario  4096 Nov 27 19:28 condivisione
 
 View user's profile Send private message  
Reply with quote Back to top
muchan
Post subject:   PostPosted: 29.11.2010, 11:56
Moderator


Joined: 2010-09-11
Posts: 468

try adding one line of
      Code:

browseable = yes

before or after "guest ok = yes"
 
 View user's profile Send private message  
Reply with quote Back to top
darioOffline
Post subject:   PostPosted: 29.11.2010, 13:35



Joined: 2010-11-27
Posts: 63

Status: Offline
I've added the line but the problem is still there, I get the same error from Windows. It's very strange, I can't see differences between the two folders' settings. I'll read again the Samba documentation to see if i missed some configuration step.
 
 View user's profile Send private message  
Reply with quote Back to top
finottiOffline
Post subject:   PostPosted: 29.11.2010, 16:00



Joined: 2010-09-12
Posts: 315

Status: Offline
Do you have a smb.conf.master? Check its contents if you do. There are some options such as:

      Code:

(...)
#======================= Share Definitions =======================

[homes]
   comment = Home Directories
   browseable = no

# By default, the home directories are exported read-only. Change the
# next parameter to 'no' if you want to be able to write to them.
   read only = yes

# File creation mask is set to 0700 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0775.
   create mask = 0700
(...)
 
 View user's profile Send private message  
Reply with quote Back to top
darioOffline
Post subject:   PostPosted: 29.11.2010, 16:23



Joined: 2010-11-27
Posts: 63

Status: Offline
Yes, that is similar to the default configuration that was in smb.conf, should I copy the [homes] section in smb.conf?
This is the default configuration:
      Code:

[homes]
   comment = Home Directories
   browseable = no

# By default, the home directories are exported read-only. Change the
# next parameter to 'no' if you want to be able to write to them.
   read only = yes

# File creation mask is set to 0700 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0775.
   create mask = 0700

# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
   directory mask = 0700

# By default, \\server\username shares can be connected to by anyone
# with access to the samba server.
# The following parameter makes sure that only "username" can connect
# to \\server\username
# This might need tweaking when using external authentication schemes
   valid users = %S

# Un-comment the following and create the netlogon directory for Domain Logons
# (you need to configure Samba to act as a domain controller too.)
;[netlogon]
;   comment = Network Logon Service
;   path = /home/samba/netlogon
;   guest ok = yes
;   read only = yes

# Un-comment the following and create the profiles directory to store
# users profiles (see the "logon path" option above)
# (you need to configure Samba to act as a domain controller too.)
# The path below should be writable by all users so that their
# profile directory may be created the first time they log on
;[profiles]
;   comment = Users profiles
;   path = /home/samba/profiles
;   guest ok = no
;   browseable = no
;   create mask = 0600
;   directory mask = 0700

[printers]
   comment = All Printers
   browseable = no
   path = /var/spool/samba
   printable = yes
   guest ok = no
   read only = yes
   create mask = 0700

# Windows clients look for this share name as a source of downloadable
# printer drivers
[print$]
   comment = Printer Drivers
   path = /var/lib/samba/printers
   browseable = yes
   read only = yes
   guest ok = no
# Uncomment to allow remote administration of Windows print drivers.
# You may need to replace 'lpadmin' with the name of the group your
# admin users are members of.
# Please note that you also need to set appropriate Unix permissions
# to the drivers directory for these users to have write rights in it
;   write list = root, @lpadmin

# A sample share for sharing your CD-ROM with others.
;[cdrom]
;   comment = Samba server's CD-ROM
;   read only = yes
;   locking = no
;   path = /cdrom
;   guest ok = yes

# The next two parameters show how to auto-mount a CD-ROM when the
#       cdrom share is accesed. For this to work /etc/fstab must contain
#       an entry like this:
#
#       /dev/scd0   /cdrom  iso9660 defaults,noauto,ro,user   0 0
#
# The CD-ROM gets unmounted automatically after the connection to the
#
# If you don't want to use auto-mounting/unmounting make sure the CD
#       is mounted on /cdrom
#
;   preexec = /bin/mount /cdrom
;   postexec = /bin/umount /cdrom
 
 View user's profile Send private message  
Reply with quote Back to top
muchan
Post subject:   PostPosted: 29.11.2010, 16:40
Moderator


Joined: 2010-09-11
Posts: 468

maybe from [homes] to [netlogon] can affect to your case.
 
 View user's profile Send private message  
Reply with quote Back to top
finottiOffline
Post subject:   PostPosted: 30.11.2010, 13:20



Joined: 2010-09-12
Posts: 315

Status: Offline
Have you tried to change "browseable" to yes and "read only" to no in [home]?
 
 View user's profile Send private message  
Reply with quote Back to top
dieresOffline
Post subject:   PostPosted: 30.11.2010, 17:01



Joined: 2010-09-12
Posts: 30

Status: Offline
did you try

force user = dario
force group = dario
force directory mode = 4777
force create mode = 4777

is your home on a different filesystem ?
then wide links should be true/yes not false/no
but that should be the same for your public

I always use security = user
 
 View user's profile Send private message  
Reply with quote Back to top
darioOffline
Post subject:   PostPosted: 01.12.2010, 00:07



Joined: 2010-11-27
Posts: 63

Status: Offline
I tried to set to yes wide links but nothing changed. For the other suggestions i don't know what will exactly do these options in the [homes] section. If I set browseable to yes and read only to no the whole home folder will become shared, correct? (I also tried to add a "default" [homes] section with browseable=no and read only=yes but nothing changed again)
 
 View user's profile Send private message  
Reply with quote Back to top
finottiOffline
Post subject:   PostPosted: 01.12.2010, 12:10



Joined: 2010-09-12
Posts: 315

Status: Offline
      dario wrote:
For the other suggestions i don't know what will exactly do these options in the [homes] section. If I set browseable to yes and read only to no the whole home folder will become shared, correct?


I don't *think* so. You should only make browseable what you share. But you can try and see...

My suggestion is to make a backup of the original config files and try some different settings.
 
 View user's profile Send private message  
Reply with quote Back to top
dieresOffline
Post subject:   PostPosted: 01.12.2010, 15:46



Joined: 2010-09-12
Posts: 30

Status: Offline
I've just tested to share directory sambashare in /home/user

ls -l
      Quote:
drwxrwxrwx 2 didi didi 4096 1. Dez 16:27 sambashare


my smb.conf
      Quote:
[global]
workgroup = MEISENWEG
server string = %h server
wins server = 192.168.3.222
dns proxy = no
log file = /var/log/samba/log.%m
max log size = 1000
syslog = 0
panic action = /usr/share/samba/panic-action %d
security = user
encrypt passwords = true
passdb backend = tdbsam
obey pam restrictions = yes
unix password sync = yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
pam password change = yes

[homes]
comment = Home Directories
browseable = no

read only = yes

create mask = 0700

directory mask = 0700

valid users = %S



[printers]
comment = All Printers
browseable = no
path = /var/spool/samba
printable = yes
guest ok = no
read only = yes
create mask = 0700

[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = yes
guest ok = no

[myshare]
read only = no
path = /home/didi/sambashare
guest ok = yes
writeable = yes
browseable = yes
force user = didi
force Group = didi
force create mode = 4777
force directory mode = 4777


where I only have edited the terms security, workgroup and winsserver and added myshare

then added user to smbpasswd:

      Quote:
smbpasswd -a didi


then restarted samba and I can access with win7 client.
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 12 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by Zafenio