Simply, Teaching Puppy to SAMBA (share folders to LAN users)
Simply, Teaching Puppy to SAMBA (share folders to LAN users)
Digressing for a moment to “level set
Last edited by gcmartin on Wed 04 Mar 2015, 20:04, edited 11 times in total.
- plankenstein
- Posts: 120
- Joined: Sun 16 Nov 2008, 00:49
- Location: Arkansas, USA
Startup script
Great, gcmartin.
Hope this document helps pupians.
I like to add a tip to start up samba automatically at the booting up Puppy.
Three points:
Notice: the shared path should be readable/writable from the samba user. If you set it as 'root', as gcmartin wrote on the top article, you need not care of.
But the smb.conf.example in my SFS is the user 'spot' as the default. Sharing /root/spot is no problem.
http://www.murga-linux.com/puppy/viewtopic.php?t=60836
Hope this document helps pupians.
I like to add a tip to start up samba automatically at the booting up Puppy.
Three points:
- hostname: Edit the file '/etc/hostname', replace 'puppypc' to the machine name you decided like 'NewPuppy'.
- Startup script: Place some script to start up samba in the directory '/etc/init.d'. Say the name '/etc/init.d/smb'.
It is called as 'smb start' at the Puppy boots up, and called as 'smb stop' at Puppy shutdown. - Mounting partition: Make some mounting measure if the shared path is under /mnt other than /mnt/home.
You can write the mounting command like 'mount /dev/sdb1 /mnt/sdb1' in '/etc/rc.d/rc.local' or in the script /etc/init.d/smb'
Notice: the shared path should be readable/writable from the samba user. If you set it as 'root', as gcmartin wrote on the top article, you need not care of.
But the smb.conf.example in my SFS is the user 'spot' as the default. Sharing /root/spot is no problem.
http://www.murga-linux.com/puppy/viewtopic.php?t=60836
- Attachments
-
- smb.gz
- A sample of the start up script, '/etc/init.d/smb'.
You need not this if you use my SFS, samba-3.5.5-lucid.sfs or samba-3.0.26-3-{sfs4,sfs3}.sfs.
Modification required if you use this for another buils of PET or SFS. - (946 Bytes) Downloaded 2234 times
Downloads for Puppy Linux [url]http://shino.pos.to/linux/downloads.html[/url]
-
- Posts: 6
- Joined: Sun 07 Nov 2010, 19:10
- Location: Bavarian alps, Frugal Puppy 5.2 & Thinkpad A22e 256 MB 20 GB/750GB Ultrabay SATA Adapter
Samba with an NTFS USB Share
First of all I would like to thank you for this great guide. With it I could set up Samba 3.5.5 with shinobars and gcmartins explanations without much fuzz! But one thing I couldn't figure out (I'm using Puppy 5.1.1):
A mounted NTFS USB drive (sdb1) cannot be accessed by either an Ubuntu (Lucid) or Windows (XP) computer, which are in the same subnet. If I attach a FAT32 USB drive, everything is fine.
The corresponding log shows:
Below parts of my smb.conf
I activated/deactived most of the parameters seen in the "schmakmu" section, but to no avail.
Anybody got an idea?
A mounted NTFS USB drive (sdb1) cannot be accessed by either an Ubuntu (Lucid) or Windows (XP) computer, which are in the same subnet. If I attach a FAT32 USB drive, everything is fine.
The corresponding log shows:
I tried to find any answer in the net, so this is my last resort."[2010/12/10 18:57:06.977049, 0] smbd/service.c:988(make_connection_snum)
canonicalize_connect_path failed for service schmakmu, path /mnt/sdb1"
Below parts of my smb.conf
Code: Select all
##
## Basic Server Settings
##
public = Yes
# workgroup = NT-Domain-Name or Workgroup-Name, eg: REDHAT4
workgroup = WESTENDNET1
# 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 = nobody
;create mask = 0644
;directory mask = 0755
...
[schmakmu]
path = /mnt/sdb1
;force user = nobody
;force group = nobody
read only = no
;public = yes
;guest only = yes
;guest ok = Yes
;writable = yes
create mask = 0765
Anybody got an idea?
Re: Samba with an NTFS USB Share
The shared storage should be both readable and writable by the user.kanehekili wrote: # Security mode.
;security = user
security = share
;map to guest = Bad User
null passwords = Yes
guest account = nobody
;create mask = 0644
;directory mask = 0755
As for the Windows partitions(ntfs/vfat), it should be mounted with the owner is the user.
The script /etc/init.d/smb does it automatically.
A trap is the partition are better to be mounted by this script, means it should not be mounted before. So you cannot boot up Puppy from the shared (ntfs or vfat) partition because it is owned by 'root' in the case.
Another trap may be the user 'nobody'. I recommend user 'spot' or 'ftp'.
The script /etc/init.d/smb is already in my sfs. Also the/etc/opt/samba/smb.conf.example can be a help.
BTW, Are you sure you are using samba-3.5.5-lucid-1.sfs?
http://www.murga-linux.com/puppy/viewtopic.php?t=60836
Downloads for Puppy Linux [url]http://shino.pos.to/linux/downloads.html[/url]
-
- Posts: 6
- Joined: Sun 07 Nov 2010, 19:10
- Location: Bavarian alps, Frugal Puppy 5.2 & Thinkpad A22e 256 MB 20 GB/750GB Ultrabay SATA Adapter
Shinobar,
thanx for your time to help.
I intend to use that drive for data, not for puppy.
+mnt+home+samba-3.5.5-lucid-1.sfs
I'll fiddle around some more- but even if I don't get it running with that specific drive - (my Fat32 USB drive works perfectly with Samba) - I'm very pleased with the Samba Pet.
thanx for your time to help.
It is readable/writable, when looking at the flags. I'm using your script for mounting- so when puppy started, (and samba as well) the sdb1 drive is mounted by your script.The shared storage should be both readable and writable by the user.
As for the Windows partitions(ntfs/vfat), it should be mounted with the owner is the user.
I intend to use that drive for data, not for puppy.
So I will look into the users againAnother trap may be the user 'nobody'. I recommend user 'spot' or 'ftp'.
Yes, I'm positive, since I do have a frugal installation, your sfs file is mounted in /mnt asBTW, Are you sure you are using samba-3.5.5-lucid-1.sfs?
+mnt+home+samba-3.5.5-lucid-1.sfs
I'll fiddle around some more- but even if I don't get it running with that specific drive - (my Fat32 USB drive works perfectly with Samba) - I'm very pleased with the Samba Pet.
@kanehekili, Try this:
In a terminal window:and in the smb.conf resource
P.S. Question: What Puppy distro did you install your SAMBA to? Thx.
In a terminal window:
Code: Select all
chmod 1777 /mnt/sdb1
Code: Select all
[schmakmu]
path = /mnt/sdb1
...
...
force create mode = 764
force directory mode = 775
...
Re: Samba with an NTFS USB Share
Confirmed. Seems ntfs permission problem.kanehekili wrote:A mounted NTFS USB drive (sdb1) cannot be accessed by either an Ubuntu (Lucid) or Windows (XP) computer, which are in the same subnet. If I attach a FAT32 USB drive, everything is fine.
The corresponding log shows:"[2010/12/10 18:57:06.977049, 0] smbd/service.c:988(make_connection_snum)
canonicalize_connect_path failed for service schmakmu, path /mnt/sdb1"
It may be complex.
I tried with editing the mount script, /etc/init.d/smb at line 41:
(Replaced 'mount' with 'mount-FULL'.)mount-FULL $MOUNTOPT -t $FS /dev/$PART /mnt/$PART
Then i could read the NTFS shared, but couldn't write...
Needs more investigation...
Downloads for Puppy Linux [url]http://shino.pos.to/linux/downloads.html[/url]
I looked at this in Samba-TNG and got the same result. Here is a test situation independent of Samba.
1. I mount an NTFS partition as usual by clicking on its drive icon.
2. I open a terminal window and login as an unprivileged user.
3. I then try to access the mount point. It's not even recognized as a directory!
So if I start the samba server and use the NTFS drive as a share, then an unprivileged samba client won't be able to see it either. However a client logging in as "root" gets full rights to the share.
I suspect that this a result of how the ntfs-3g driver mounts the share. There may be some convoluted way of using ntfs-3g that solves the problem for unprivileged users.
1. I mount an NTFS partition as usual by clicking on its drive icon.
2. I open a terminal window and login as an unprivileged user.
3. I then try to access the mount point. It's not even recognized as a directory!
So if I start the samba server and use the NTFS drive as a share, then an unprivileged samba client won't be able to see it either. However a client logging in as "root" gets full rights to the share.
I suspect that this a result of how the ntfs-3g driver mounts the share. There may be some convoluted way of using ntfs-3g that solves the problem for unprivileged users.
-
- Posts: 6
- Joined: Sun 07 Nov 2010, 19:10
- Location: Bavarian alps, Frugal Puppy 5.2 & Thinkpad A22e 256 MB 20 GB/750GB Ultrabay SATA Adapter
Well, I guess I found a way to access my drive now.
After I tried the variations of gcmartin and shinobar, with no success I came up with the following solution :
So I used the advices of shinobar and gcmartin but the final solution was the line
Now I'm not really sure if I compromise my system by allowing everyone to become root...
After I tried the variations of gcmartin and shinobar, with no success I came up with the following solution :
Code: Select all
# Security mode.
security = share
null passwords = Yes
guest account = spot
[schmakmu]
path = /mnt/sdb1
force user = root
read only = no
force create mode = 764
force directory mode = 775
create mask = 0765
I could copy and remove data to the drive without any problems. I dimly remember that I have read something about NTFS and linux and problems due to security...force user = root
Now I'm not really sure if I compromise my system by allowing everyone to become root...
What is the difference between logging into a share as a non-privileged user with full rights to the data versus logging in as root?kanehekili wrote:Now I'm not really sure if I compromise my system by allowing everyone to become root... :?
It's not like you are giving the user root access to the whole server. If you are concerned about the safety of the data, just put a "read only" restriction on the share.
Logging into a Samba server as root is less dangerous than running Puppy as root.
force user = root
Great!kanehekili wrote:force user = root
I think it is most practical solusion.
Downloads for Puppy Linux [url]http://shino.pos.to/linux/downloads.html[/url]
In this example, as you show, you have told SAMBA that for this share [schmakmu], to let a user named "root" to have access to it. In other words, you have given ONLY the root SAMBA user the priviledge to ONLY this share....not to your Linux system. SAMBA did what you told it to; and he did not and will not go beyond what you told him.kanehekili wrote:Now I'm not really sure if I compromise my system by allowing everyone to become root..
Another important thing to remember is SAMBA users are separate users from Linux system users. So, if you want /need, you can create additional SAMBA users and also give those IDs access to this share as well. That way, by looking thru the SAMBA log, you can see which LAN user accessed this share and when.
Hope this helps.
Any other concerns, post them and we'll help.
Could you confirm this? It's been my experience that a username must already exist as a Linux user before it can be created as a Samba user. Otherwise, the server won't know whether the user has the requisite privileges to access a share.Another important thing to remember is SAMBA users are separate users from Linux system users. So, if you want /need, you can create additional SAMBA users and also give those IDs access to this share as well. That way, by looking thru the SAMBA log, you can see which LAN user accessed this share and when.
in Linux, full SAMBA as I have created the smb.conf where there is NO LDAP server or PDC (and version 4 full SAMBA with AD), SAMBA authentication does NOT require ANY comparative Linux user. Always has been this way as far as I remember.rcrsn51 wrote:Could you confirm this? It's been my experience that a username must already exist as a Linux user before it can be created as a Samba user. Otherwise, the server won't know whether the user has the requisite privileges to access a share.
Hope this helps.
P.S. I haven't tested this in Puppy, though, but it should be the same.
Edited: I believe I withdraw my comments about SAMBA users and Linux users. Although I seem to remember the user systems as being distinct, it appears that there IS A RELATIONSHIP which @Rcrsn51 more accurately references...thanks
See this document for a VERY GOOD EXPLANATION on SAMBA USERS. There are many many other useful SAMBA documents on the internet as well.
Managing Users in SAMBA
Code: Select all
force user = root
Code: Select all
force user = root,spot,Mom,Dad,Sister,ElderlyNeighbor,Me
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?"
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.
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
So sorry that I just got this. Seems that there are several issues so I will attempt to address them individually.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.
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
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
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
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 have cheked that directory /mnt/sdb1/Photo is accessible to any one (respectively / 755 / 777 / 777 /)
what's wrong ? any idea