Page 1 of 4

Posted: Tue 14 Dec 2010, 13:28
by rcrsn51
force user = root
This is a handy trick! It means that you can create non-privileged users with personal home directories on the server, who can also access a FAT/NTFS share by getting temporary root privilege.

You can control the amount of privilege in the share with "writable" or "read only".

Managing Users in SAMBA

Posted: Wed 15 Dec 2010, 23:13
by gcmartin

Code: Select all

force user = root
Yes, this allows user root to have that privilege; and any other users that I might have on the LAN, as well, for example

Code: Select all

force user = root,spot,Mom,Dad,Sister,ElderlyNeighbor,Me
Assuming those of the names those users use to logon to their Windows PCs.

Just a note for anyone interested: M$ charges an entry level $1000+ for the Basic Server which does this. IFF you use your search engine for "Linux SAMBA PDC" you will probably find 100 documents of others before us who have setup SAMBA to manage ALL users on your network and what they can and cant see. Its really simple after you get past what we've just done here in "Teaching Puppy to SAMBA". Anyone's choice: $1000 or Open-Source..."What say you?"

Posted: Fri 08 Apr 2011, 16:43
by 8-bit
I am running Puppy Lupu 520 first of all as a frugal install.
I tried following your how to to get the initial settings done and then I tried the commands from a terminal pertaining to retstart.
I had samba-3.5.5-lucid.sfs loaded.
but the restart option was not recognized as a valid option.

Also, all drive and file access on my pc slowed up greatly.
I ended up recovering using a backup of my lupusave.2fs file I had previously made and then copying apps I had installed in wine drive c by removing drive_c and copying the one from the bad pupsave file.
So now, I am at a loss as to where to go from here.

Also, I should mention the the nested mkdir command did not work and I had to make each directory individually.
And smbd and nmbd were reported as not found.
I had to make links to them in /usr/bin to access them.

So simple was not so simple in my case.

there were some problems with the differing SFSs

Posted: Wed 13 Apr 2011, 23:36
by gcmartin
8-bit wrote:I am running Puppy Lupu 520 first of all as a frugal install.
I tried following your how to to get the initial settings done and then I tried the commands from a terminal pertaining to retstart.
I had samba-3.5.5-lucid.sfs loaded.
but the restart option was not recognized as a valid option.

Also, all drive and file access on my pc slowed up greatly.
I ended up recovering using a backup of my lupusave.2fs file I had previously made and then copying apps I had installed in wine drive c by removing drive_c and copying the one from the bad pupsave file.
So now, I am at a loss as to where to go from here.

Also, I should mention the the nested mkdir command did not work and I had to make each directory individually.
And smbd and nmbd were reported as not found.
I had to make links to them in /usr/bin to access them.

So simple was not so simple in my case.
So sorry that I just got this. Seems that there are several issues so I will attempt to address them individually.

Firstly, lets start with a nested Linux mkdir command. Would you try that first, and report back.

Next, there were problems with the SFSs files for 3.5.5. I'm not sure which of them you are using. One of them follows the directions, but the other was a sharp departure from the directions. And, for both, NEITHER are supported anymore by either author.

I am in the process of creating a new updated document for users wanted to simply add SAMBA to their non-SAMBA system. I, currently, am concentrating on the newer PUPs because those PUP distro owners have SAMBA available via PPM. This makes your use and a document more generic for all newer PUPs.

But, it you're willing, follow me and I may be able to help you without a manual. Firstly, let me ask this (I don't have a PUP520) "Live" media to boot from: Would you open your PPM and update it. Then exit the PPM and reopen it. Then click the All button in the left column. The large right column should populate. If it does, scan down that list for SAMBA. You will either see 3.4.x or 3.5.6 or 3.5.8. Which do you see?

Select it and report back here which you have (this is because some will update your Menu and the others WONT).

The next 2 things will be easy. PPM me when you hav e done this.

Thanks in advance.

Samba 3.5.6 on Lucid-Puppy 5.2.5

Posted: Sat 05 Nov 2011, 15:26
by mimmo
So the first thing for me was that "smbd -restart" did not work...

the solution came after a reboot as at this point I did have a samba running
and the disk of my shared directory was mounted
so I looked wher this guy was started

and the solution is in /etc/init.d/smb

the options are: start|stop|restart|reload|status
#smb restart

works find (I see the changes on the windows side)
from windows I access the readme in the spot home dir
but I have problems to acces Photo

my smb.conf looks like this

Code: Select all

[Photo]
   # the path should be readable and writable by the guest account
   path = /mnt/sdb1/Photo
   public = yes
   only guest = yes
   guest ok = Yes
   writable = yes
   printable = no
   create mask = 0765
   force group = spot

[spot]
   path = /root/spot
   public = yes
   only guest = yes
   guest ok = Yes
   writable = yes
   printable = no
   create mask = 0765
   force group = spot
I did the very same for Photo and spot ...
I have cheked that directory /mnt/sdb1/Photo is accessible to any one (respectively / 755 / 777 / 777 /)

what's wrong ? any idea

Re: Samba 3.5.6 on Lucid-Puppy 5.2.5

Posted: Sat 05 Nov 2011, 17:18
by gcmartin
mimmo wrote:... what's wrong ? any idea
Sorry for the problem(s). We are in the process in updating the manual with those corrections. Thanks (BTW you didn't mention which Puppy version you are using)

If I understand correctly, from your Windows PCs you are having problems getting to the 2 resources you are sharing from Puppy. Right?

If so, I would like you to do 3 things on Puppy and 2 normal things on Windows. This should help to get you started

Puppy
  1. Using your Editor
    • remove the last 2 lines on each resource "create mask= and force group=" (This is only temporarily while we get things working. add them back after you get things working)
  2. Using a terminal
    • Open a terminal and type testparm. (Please post those results back here.)
    • In terminal type "smbpasswd -a spot" (remember the password you set for spot)
    • In terminal, chmod 765 /root/spot /mnt/sdb1/Photo"
Windows (This assumes that you can see your Puppy PC in "Network Places")
  1. Open a command prompt and type
    • net use r: //IP address of your Puppy PC/Photo /user:spot password4spot
    • net use s: //IP address of your Puppy PC/spot /user:spot password4spot
      You should not get errors. If you do post them here
You should now be able to "see" and use those Puppy items from the Windows PC(s).

Please post your results for others.

Hope this helps

Samba 3.5.6 on Lucid-Puppy 5.2.5

Posted: Sat 05 Nov 2011, 19:32
by mimmo

Code: Select all


# testparm
Load smb config files from /etc/opt/samba/smb.conf
rlimit_max: rlimit_max (1024) below minimum Windows limit (16384)
Processing section "[homes]"
Processing section "[printers]"
Processing section "[Photo]"
Processing section "[spot]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

[global]
	unix charset = UTF-8
	display charset = UTF-8
	workgroup = xxxxxxxxx
	server string = Samba Server on Puppy
	security = SHARE
	map to guest = Bad User
	null passwords = Yes
	guest account = spot
	log file = /var/log/samba/log.%m
	max log size = 50
	printcap name = cups
	dns proxy = No
	message command = /usr/local/bin/LinPopUp "%f" "%m" %s; rm %s

[homes]
	comment = Home Directories
	valid users = %S
	read only = No
	browseable = No

[printers]
	comment = All Printers
	path = /var/spool/samba
	create mask = 0700
	guest ok = Yes
	printable = Yes
	use client driver = Yes
	browseable = No

[Photo]
	path = /mnt/sdb1/Photo
	read only = No
	guest only = Yes
	guest ok = Yes

[spot]
	path = /root/spot
	read only = No
	guest only = Yes
	guest ok = Yes
# 
# 
chmod 765 spot # ok (also it's a strange value for a dir)
chmod 765 Photo # did not work !!!

rebooted both puppy and window

form windows I did the commands with following syntax (got few syntax error at first) the ok/error messages are a quick translation from french

Code: Select all

>net use s: \\192.168.0.1\spot spot!! /user:spot
command executed correctly

>net use r: \\192.168.0.1\Photo spot!! /user:spot
system error 53

network path not found
s: drive OK (I can open the spot readme file find )
r: drive not present

thanks for the help
good night I'll be back tomorow :)

Re: Samba 3.5.6 on Lucid-Puppy 5.2.5

Posted: Sun 06 Nov 2011, 08:47
by gcmartin
mimmo wrote:

Code: Select all

 ... # testparm... 
...
I dont have PUP525. But, I did have a PUP528 without updates. I fired it up, added SAMBA, had to resolve PATH issues withPUP528, then define a resource and started SAMBA. Worked fine aside from the pathing issues on PUP528 Two-headed Dog

2 things,

I seem to remember somethings about Windows needing to have a service restart when this happened. To prove it, please restart Windows and REVERSE the order of "net use" requests.

ALSO I do remember reporting some issues to Playdayz on some problems with this combination of PPM SAMBA on PUP525. Something was odd about the installation of SAMBA on this Puppy.

I will follow up with you after church and family, later today. This is the only distro that I had any problems unusual problems with.

Samba 3.5.6 on Lucid-Puppy 5.2.5

Posted: Sun 06 Nov 2011, 16:07
by mimmo
@gcmartin
many thanks,

I was wondering why I should update to 5.2.8 I think you just gave ma a good reason :D

So I try with 5.2.8 and samba 3.5.6 and ...

it failed in the exact same way spot is ok and photo is not :cry:

I didn't find the smbpasswd ! (I don't know if I realy need it)

I'm also fighting with the aliases in roxterm ...

did you try on a directory other than one under /root ?

don't want to poise your sunday :?

Samba 3.5.6 on Lucid-Puppy 5.2.5

Posted: Sun 06 Nov 2011, 21:20
by gcmartin
mimmo wrote:@gcmartin ...
Here's a complete installation kit for you use. Should address all short comings that you'll hit using PUP 5.2x.

PM me with any questions you might have.

Hope this helps.

Samba 3.5.6 on Lucid-Puppy 5.2.5

Posted: Tue 08 Nov 2011, 20:57
by mimmo
So I followed all this and more ...

what I believe is that the problem comes when I try to have a link to a directory that is not physically under /root

for example in confd.conf I add

Code: Select all

[puppyref]
   # the path should be readable and writable by the guest account
   path = /root/puppy-reference
   read only = No
   guest ok = Yes
I do get acces to "puppyref" from my windows PC
the links are visible but cannot be followed

I tested some other cases of links from spot/ to ../puppy-reference (all under /root ) and it's not functional

Code: Select all

# pwd
/root/spot
# ls -al
total 3941
drwxr-xr-x  6 spot spot    4096 2011-11-08 21:40 .
drwxr-xr-x 59 root root    4096 2011-11-08 21:18 ..
drwxr-xr-x  2 root root    4096 2011-11-08 21:37 aRootDir
drwxr-xr-x  2 spot spot    4096 2011-11-08 21:38 aSpotDir
drwxr-sr-x  2 root root    4096 2011-11-08 21:30 .didiwiki
-rwxrw-r--  1 spot spot 4007512 2011-09-25 13:10 IMG_0001.JPG
lrwxrwxrwx  1 root root      19 2011-11-08 21:40 PUPREF -> ../puppy-reference/
-rw-r--r--  1 spot spot     580 2009-11-19 10:03 README.txt
# 

So I believe that the problem is here the links are not possible to follow
and /mnt/sdb1/Photo is kind of a link (to the drive)


to check this I also tried a direct link not under root

Code: Select all

[optsamba]
   # the path should be readable and writable by the guest account
   path = /opt/samba
   read only = No
   guest ok = Yes
and this one works find I'm perfectly able to browse the full tree of samba from windows

please try to share another mounted disk

Note:the 'smbpasswd' command now works I believe that the rehash on restart brought me that

Re: Samba 3.5.6 on Lucid-Puppy 5.2.5

Posted: Wed 09 Nov 2011, 23:47
by gcmartin
mimmo wrote:So I followed all this and more ...
There is a problem that I have just confirmed with Lupu528-002M. Seems to have the problem you've just described; namely multi-level directories of items in on the HDD are not able to be accessed from Windows or any other LAN PCs.

There is something very odd about what's happening with the running Live media system with Lupu multimedia ISO. And, something also is "begging" in ROX+Puppy filesystem.

Here's what's happening: Your system boots to desktop. You have some directories defined in /etc/opt/samba/smb.conf that is 3 levels deep (i.e. /mnt/sda1/somefolder.) that have been granted rights of 777 via chmod. When you start SAMBA, he starts normal without error messages. On ANY LAN PC, you try to mount the resource(s) and you DO NOT ACCESS to the resource as you expect.

Resolution:
  1. Stop SAMBA
  2. Exit to Prompt
  3. Umount the HDD resources you are trying to access
  4. Now, remount those resources
  5. restart SAMBA
  6. Go to any other LAN PC and mount the resources you had problems with before.
You will see that you can now access them.

This is NOT a problem with SAMBA. Its a problem with the running Filesytem in Puppy.

I am unclear as why this is occurring in this Puppy distro series.

Posted: Thu 10 Nov 2011, 00:50
by playdayz
Live media system with Lupu multimedia ISO
The Multimedia ISO of 528-002 has been withdrawn. Well it was never released--it was a test vehicle. http://www.murga-linux.com/puppy/viewto ... 224#581224

I am curious to know whether lupu-528.iso (the release on AUG 7 2011) and/or lupu-528.002.iso (currently in testing) have this behavior. I am holding lupu-528.002.iso for another issue. One difference is that lupu-528.iso was created with Woof and lupu-528.002.iso (and lupu-528.002M.iso) were created by remastering. If there is a problem with remastering it would be good to know.

It would also be worth knowing whether Three-Headed Dog (luci-001) has the behavior also--it will be updated and an updated iso released in the future.

Re: Samba 3.5.6 on Lucid-Puppy 5.2.5

Posted: Thu 10 Nov 2011, 17:13
by rcrsn51
mimmo wrote:works find (I see the changes on the windows side)
from windows I access the readme in the spot home dir
but I have problems to acces Photo
Just for clarification:

Exactly what problems are you having?

What kind of device is sdb1? An external USB drive? With what filesystem is it formatted? Is it mounted?

Under what user name are you logging into the Samba server from Windows? As root, spot or guest?

Posted: Thu 10 Nov 2011, 17:59
by gcmartin
Most noticeable when you have a share define for say

Code: Select all

path = /sda1/folder/subfolder
This is where 3.5.6 on Puppy 528's having issues. It I set the share to "/sda1/folder", problem won't surface. This has occurred on both HDD/USB storage.

@Rcrsn51
Are you using Live media 528 and the PPM's SAMBA?

There are couple 528 application issues I'm seeing in Live media operation, that I wonder if somehow they MAY be related. Or maybe, there is a necessary operations step for Live media use that must be done. Thus far, no shortcuts have been taken and all installation and use is via PPM with standard desktop restarts. I have not rebooted the 528002M that i started with last week.

If you are not having these same problems with PPM and 528M please report what you are seeing. What you see/know may not just apply here, but help PUP528M as well.

Thanks in advance for any help

Posted: Thu 10 Nov 2011, 18:06
by rcrsn51
The only reason I asked is because mimmo's problem with sdb1 might be related to kanehekili's on the first page.

Posted: Thu 10 Nov 2011, 18:32
by rcrsn51
gcmartin wrote:Most noticeable when you have a share define for say

Code: Select all

path = /sda1/folder/subfolder
This is where 3.5.6 on Puppy 528's having issues. It I set the share to "/sda1/folder", problem won't surface. This has occurred on both HDD/USB storage.
Using Lupu 528 in PUPMODE=5 (ie without a save file) and Samba-TNG, I did the following:

1. created the folder /mnt/sda4/dir/subdir
2. gave ownership of subdir to spot
3. put a symlink in subdir to another location (like mimmo did in his example)
4. created a samba share for subdir with the sole option "writable = yes"
5. started the samba server
6. from a Windows client, logged in as user spot

It worked correctly. I got write access to the subdir folder and could follow the symlink.

Samba 3.5.6 on Lucid-Puppy 5.2.5 or 5.2.8

Posted: Thu 10 Nov 2011, 20:47
by mimmo
Hi all

I have installed 528 (and 525 ) frugal on /sda6

/mnt (root:root 755)
/sdb1 is another hard drive (root:root 777) FAT32 used to be my D: drive on windows
/Photo the photo dir I wish to share (root:root 777)
all dir after Photo are (root:root 777)

on the window explorer I see the "photo" dir but when trying to open it it fails

I was able to share
- spot ( /root/spot spot:spot 755 ) with access to files
- puppy-reference ( /root/puppy-reference root:root 777 )
in this one I can read an image I have put here
I can see all the link (standard install) but I cannot follow these links (all L777 i.e. lrwxrwxrwx ) see attached
I even wrote the windows snapshot there to post it ( was created a root:root 755)

it doesn't look like a pb of plain user access right

Thanks to all hope this helps

Samba 3.5.6 on Lucid-Puppy 5.2.5 or 5.2.8

Posted: Thu 10 Nov 2011, 21:12
by mimmo
I tried (just for fun :D ) to have a complex conf

what I have is that:
- only the last drive is mounted (sda5 in this case not sda1 nor sdb1 )
- all dir are "visible" from windows but only the one on the virtual
"lupusave.2fs" are realy accessible ( spot, puppyref and optsamba )

Code: Select all

# A Simple Samba configuration file for shared strage and printer for public. 
#======================= Global Settings =====================================
[global]

# BK LinPopUp requires this
message command = /usr/local/bin/LinPopUp "%f" "%m" %s; rm %s

##
## Basic Server Settings
##

	# workgroup = NT-Domain-Name or Workgroup-Name, eg: REDHAT4
	workgroup = xxx


	# server string is the equivalent of the NT Description field
	server string = Samba Server on Puppy

	#BK think need to change this...
	log file = /var/log/samba/log.%m
	# Put a capping on the size of the log files (in Kb).
	max log size = 50

	# Security mode.
	;security = user
	security = share
	map to guest = Bad User
	null passwords = Yes
	guest account = spot

##
## Network Browsing
##
	# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names
	# via DNS nslookups.
	dns proxy = no

##
## Printing
##
	# Assume using CUPS
	load printers = yes
	printcap name = cups
	printing = cups

   # chacter set
   unix charset = UTF-8
   ;dos charset = CP932
   display charset = UTF-8

#============================ Share Definitions ==============================
[homes]
     comment = Home Directories
     browseable = no
     writable = yes
     valid users = %S

# NOTE: If you have a BSD-style print system there is no need to
# specifically define each individual printer
[printers]
   comment = All Printers
   user account = spot
   create mode = 0700
   # the permission of the path should be 1777
   path = /var/spool/samba
   browseable = yes
   public = yes
   guest ok = yes
   printable = yes
   # allow Windows to use its printer driver
   use client driver = yes

[puppyref]
   # the path should be readable and writable by the guest account
   path = /root/puppy-reference
   read only = No
   guest ok = Yes

[optsamba]
   # the path should be readable and writable by the guest account
   path = /opt/samba
   read only = No
   guest ok = Yes

[ancienne]
   # the path should be readable and writable by the guest account
   path = /mnt/sdb1/Photo_Ancienne
   read only = No
   guest ok = Yes


   #force group = spot
   # user root for ntfs
   #force user = root
   #public = yes
   #guest ok = Yes
   #writable = yes
   #printable = no
   #create mask = 0765

[photo]
   path = /mnt/sdb1/Photo
   public = yes
   only guest = yes
   guest ok = Yes
   writable = yes
   printable = no
   create mask = 0765
   force group = spot

[spot]
   path = /root/spot
   public = yes
   only guest = yes
   guest ok = Yes
   writable = yes
   printable = no
   create mask = 0765
   force group = spot
   
[windows]
   path = /mnt/sda1/WINDOWS
   public = yes
   only guest = yes
   guest ok = Yes
   writable = yes
   printable = no
   create mask = 0765
   force group = spot
   
[diving]
   path = /mnt/sda5/plongee
   public = yes
   only guest = yes
   guest ok = Yes
   writable = yes
   printable = no
   create mask = 0765
   force group = spot
   

Posted: Thu 10 Nov 2011, 21:36
by rcrsn51
The best way to debug Samba is to do the simplest thing first.

1. In the [global] section, put the security mode back to "user". That will force the client to login, so you know exactly what ownership/permissions are in effect.

2. Make your share definitions as simple as possible. All you really need is

Code: Select all

[photo]
   path = /mnt/sdb1/Photo
   writable = yes 
3. From the Windows client, login as user "root".