Samba-3.0.21c (file&printer sharing) -- full Samba build

Stuff that has yet to be sorted into a category.
Message
Author
User avatar
jmarsden
Posts: 265
Joined: Sat 31 Dec 2005, 22:18
Location: California, USA

Samba-3.0.21c (file&printer sharing) -- full Samba build

#1 Post by jmarsden »

At http://www.dotpups.de/dotpups/Network/Samba-3.0.21c.pup (thanks MU) you will find a dpupmaker.sh created binary Samba dotpup (with minor mods to its dotpup.sh after the automated creation was complete). When installed, Samba autostarts and adds itself to /etc/rc.local so it will autostart on subsequent boots too. It is a fairly large download by Puppy standards, approaching 17MBytes.

This setup uses the smb.conf file supplied with Puppy itself, the one in /etc/samba/smb.conf, and does not modify that file in any way. Feel free to edit it to configure Samba more to your liking.

Out of the box, this dotpup shares your /root directory read-write, and the Samba root pw is empty! This is a major security issue IF you are foolish enough to run Samba on the global Internet. So don't do that! On a local LAN behind a router/firewall, or with an appropriately configured rc.firewall script in Puppy itself limiting access to your local LAN systems only, it is fine as a quick simple starting point. Use smbpasswd to play with changing and adding Samba user accounts and passwords.

This dotpup is the latest result of a lengthy developer dialogue here on these forums with sunburnt regarding Samba dotpup creation. It works for me on two different machines. If you have issues with it, let me know, and please check any log files under /var/ that may be relevant, such as /var/log.nmbd and /var/log.smbd for useful messages.

To test it, at a Puppy shell prompt try

Code: Select all

smbclient \\\\localhost\\root -N  # on the server Puppy machine, or better still:
smbclient \\\\192.168.0.1\\root -N # on a nearby client Puppy machine, use your own IP address
or just browse the Network Neighbourhood from a local Windows PC in the MYGROUP workgroup (or edit /etc/samba/smb.conf to set whatever workgroup you want!).

I have had little success with LinNeighbourhood as yet. Anyone who can consistently get LinNeighbourhood to work with this Samba server setup, please let me know the details!

Also, it can take several minutes (as in, 6 or 7 minutes, not as in 300!) for Samba to decide it can set itself up as a local browser and so allow WIndows Network Neighbourhood to see it. I am not sure whether this can be sped up by appropriate smb.conf entries.

Jonathan

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#2 Post by Lobster »

Not even sure what Samba is - a sort of Dance?
I read this and I am still not sure how or why it is used?
http://en.wikipedia.org/wiki/Samba_software

How to config it:
http://www.samba.netfirms.com/

Well done :)
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

User avatar
jmarsden
Posts: 265
Joined: Sat 31 Dec 2005, 22:18
Location: California, USA

#3 Post by jmarsden »

SAMBA is the Linux equivalent of "File and Printer Sharing" in Windows. So, if you want to share files on (or printers connected to) a Puppy Linux system, in the same way that Windows can share its files and printers with other computers... you would use SAMBA.

There is plenty of documentation included with the dotpup, after installation you will find man pages under file:///usr/share/samba/swat/help/manpages/ and also several HOWTOs and books... point your browser to file:///usr/share/samba/swat/help/using_samba/toc.html to start reading the O'Reilly book "Using Samba, 2nd Edition" for example. Try file:///usr/share/samba/swat/help/Samba3-HOWTO/index.html to read "The Official Samba-3 HOWTO and Reference Guide". file:///usr/share/samba/swat/help/Samba3-ByExample/index.html will get you the book "Samba-3 by Example", recently updated for Samba 3.0.20 and later.

If you read all the books, HOWTOs and manpages, try the ideas in them, and stil think Samba is just a dance... there may be no cure for what ails you :-)

Jonathan

SamSung
Posts: 96
Joined: Fri 14 Oct 2005, 17:50
Location: France

#4 Post by SamSung »

Another alternative and one I use on my home network is to use NASLite www.serverelements.com on an old PC fill it with four IDE drives and share this. I have a 200mhz Pentium 64MB RAM and 280GB of disks shared to my puppy network. The puppy PC's have small 500mb reclamed HDDs and nothing is saved locally but saved to the NAS box.

NASLite is on a floppy and is a snip to setup, even I did it. There is much discussion among the techioes on the NASLite forums about Read and Write speed etc. My NAS connected to my 100mb network is able to stream Music and full screen Divx video, so I do not care what the numbers are.

Anywhoo it is a workable option and keep the Puppy clients light and quick to boot. I use LinNeighbourhood to connect to the NAS no probs there, and as I use the KDE version of puppy I am looking at getting the samba connection/mounting thru Konqueror.

Well that my two centimes worth, hope it is of use to someone.

Cheers

Sam

Kal
Posts: 626
Joined: Thu 05 May 2005, 16:59
Location: California, High Desert

Samba

#5 Post by Kal »

The package does seem to have a minor issue with pupget. I just went along with the red warning, what pupget wanted to do. It removed the rc.samba file, so I replaced it and all was back up. Tried pupget again and no problem this time. The issue was repeatable on another machine.
Good Work, Kal

User avatar
jmarsden
Posts: 265
Joined: Sat 31 Dec 2005, 22:18
Location: California, USA

Re: Samba

#6 Post by jmarsden »

Kal wrote:The package does seem to have a minor issue with pupget. I just went along with the red warning, what pupget wanted to do. It removed the rc.samba file, so I replaced it and all was back up. Tried pupget again and no problem this time. The issue was repeatable on another machine.
Thanks for the feedback. Can you be more specific about Pupget and how to get the "red warning"? I've only installed it either by hand (well, OK, using my own little script to install dotpups!) and using Rox. Actually I don't think I've ever tried installing any dotpup using pupget! Do you mean that you install the dotpup using Rox, and then later run pupget and it complains?? I expect I can fix up whatever the pupget-related issue is, once I understand it.

Thanks,

Jonathan

Kal
Posts: 626
Joined: Thu 05 May 2005, 16:59
Location: California, High Desert

Samba

#7 Post by Kal »

After installing with rox, I went to pupget later to install another package with it, and that is when it said it was going to remove the samba-3.0.21c, I wish, I had written it down, sorry.
I also found that using Add and doing a query for the host name in LinNeighborhood seems to speed up the looking process on Samba.
Luck, Kal
PS: WARNING: These alien packages were previously installed, either by PupGet,
or by some other means registered with PupGet upon installation:
"samba-3.0.21c"

HOWEVER, they are also in the live-CD ISO (or usr_cram.fs in case
of other installations). This is a clash, and this script will now
force their removal. You may need to reboot for these packages on
the live-CD to be reinstated.
Note: the next 2-pane window will not show them, as they are now
scheduled for automatic removal after the 2-pane window OK
button is pressed. PLEASE DO NOT ABORT PupGet IN ANY FOLLOWING
WINDOW -- PRESS OK BUTTON IN NEXT WINDOW AND ALLOW SCRIPT TO
COMPLETE, SO THAT IT CAN REMOVE THESE OFFENDING PACKAGES --
ABORTING NOW WILL STUFF THINGS UP!

Click OK to continue script...

User avatar
jmarsden
Posts: 265
Joined: Sat 31 Dec 2005, 22:18
Location: California, USA

Re: Samba

#8 Post by jmarsden »

Kal wrote:After installing with rox, I went to pupget later to install another package with it, and that is when it said it was going to remove the samba-3.0.21c, ...
OK, thanks. I'll check this out when I get home. It sounds like the problem is because of a name clash between my Samba package and the cut-down one included with Puppy, that is just the client part. But I'll need to read the pupget code carefully to be sure what is causing this.

Jonathan

raffy
Posts: 4798
Joined: Wed 25 May 2005, 12:20
Location: Manila

Printing system?

#9 Post by raffy »

This is very useful for Puppy, as a storage-sharing system is very essential in a network of really old PCs, or even in a network of new PCs that uses a simple centralized backup storage.

Am just unsure how it handles printing from the clients? And how does it relate to CUPS? Are they mutually exclusive (drop one if you use the other)?

(Pls be patient with these questions - Samba is something that I've been trying to give time to since 2000, but alas, web servers got most of those time :( ).

And can we add there a routine for giving user root a password? (It's a problem having an empty password, as you said.)

User avatar
jmarsden
Posts: 265
Joined: Sat 31 Dec 2005, 22:18
Location: California, USA

Re: Printing system?

#10 Post by jmarsden »

raffy wrote:Am just unsure how it handles printing from the clients? And how does it relate to CUPS? Are they mutually exclusive (drop one if you use the other)?
Samba uses whatever printers you have configured in your Linux printing subsystem, and offers them to Windows clients. At least, it does if you set up a default [printers] section in smb.conf. Samba should read a printer config set up by CUPS just fine.

Note: around 1994/95 and Samba 1.8.x, I was a fairly serious Samba expert user and configurer... but it has changed so much since then I no longer dare make such a claim!). The best way to learn probably is to read the docs and try things, and then ask questions for your specific situation (say what you have read and tried when asking).
And can we add there a routine for giving user root a password? (It's a problem having an empty password, as you said.)
This comes back to a philosophy issue. BarryK really really wants Puppy to have no root pw. So that's how it ships. So that's how my Samba package does things too. I'm being consistent with his design choices, or trying to!

I'm reluctant to create and publish a dotpup that might get popular which changes that. I'd prefer the user understand the implications and make the choice themselves. One thing that could be interesting would be to have a boot time option in Puppy itself that results in verifying whether the current root pw is blank or not and if it is, prompting for one? One extra keypress for those who don't want a root pw, and increased security for those who do prefer a pw.

The other issue is that setting a "default" root samba password is also insecure. The default is widely known and so the first thing the wannabe cracker tries!

The "routine" for setting a samba password is the smbpasswd command, which is part of the installed dotpup. There were three real options: (a) ship with no root account set up, forcing the user to run smbpasswd by hand before samba does anything useful; (b) ship with a default root pw (c) ship with an empty default root pw. Barry chose (c), and so Samba does the same. I'm interested in hearing ideas for what the "good" or "best" solution is to this.

(Note: the dotpup could prompt the user for a pw, but then it can't in installed in an automated way, and this is generally (IMO) a bad idea for package installers to run around asking the user questions. RPMs don't do that, .debs don't do that, why should .pups do that? It doesn't feel like a good solution to me.)

Jonathan

Kal
Posts: 626
Joined: Thu 05 May 2005, 16:59
Location: California, High Desert

#11 Post by Kal »

We have been using Samba with Cups for over three months. Never had a problem, but its just a home network behind a hardware firewall, not much of a security issue. At one time we limited access to one folder in smb.conf (share in /root}. We even used the bios security for the computers, but decided we were being silly for our use, we keep no banking pin numbers or anything to steal.
Kal

User avatar
jmarsden
Posts: 265
Joined: Sat 31 Dec 2005, 22:18
Location: California, USA

Re: Samba

#12 Post by jmarsden »

Kal wrote:After installing with rox, I went to pupget later to install another package with it, and that is when it said it was going to remove the samba-3.0.21c ...
OK, I get this behaviour here too. I've looked over the relevant code in pupget to see why it happens.

I'm going to take a deep breath, and then claim that, as I understand the code, this looks to me like a bug in a package in the Puppy system itself, pupget, rather than a bug in my Samba package! Here is my reasoning:

Pupget is checking whether there is an installed alien package that has the same name as one included on the CD. Fair enough. But if it detects such a package, it doesn't bother checking version numbers, or asking the user which package to keep, it just decides that the CD version must always be better than the other one, and so kicks the other one (my package, in this case) out! This makes packages that exist in the core pupget system effectively un-upgradeable. Making packages un-upgradeable is not the behaviour one usually associates with a package manager! So, to my mind, pupget's current behaviour in this case violates the Rule of Least Surprise, and should therefore be considered incorrect.

I don't understand the reasons for it's current behaviour -- there could be valid reasons, or (as I rather suspect) it could just be an accident that code to check the two version numbers was left out in the code at that point. Only BarryK can tell us whether the code is behaving as it should, and if it is, why it is necessary for it to make this decision in favour of the CD every time, rather than (for example) comparing version numbers and keeping the more recent package, or even asking the user which one they prefer to keep. Or, Barry may be able to let us know that this is just an oversight which we should fix with a small patch to /usr/sbin/pupget.

Jonathan

User avatar
KaYnemO
Posts: 26
Joined: Mon 05 Dec 2005, 16:34
Location: Moscow, Russia

How do you UNshare the /root

#13 Post by KaYnemO »

All right - I have started samba and it has /root shared. I've tried to find the needed info in the manuals, but couldn't. How do you UNshare the /root. I was able to add shares, but can't find the line in the smb.conf where the /root is mentioned as shared. Also how do you stop samba? PLEASE help!
...don't you wish you could "undo" in real-life sometimes?...

User avatar
jmarsden
Posts: 265
Joined: Sat 31 Dec 2005, 22:18
Location: California, USA

Re: How do you UNshare the /root

#14 Post by jmarsden »

KaYnemO wrote:All right - I have started samba and it has /root shared. I've tried to find the needed info in the manuals, but couldn't. How do you UNshare the /root. I was able to add shares, but can't find the line in the smb.conf where the /root is mentioned as shared.
/root is the home directory of the root user. It is shared because you have a section in your smb.conf that is named [homes]. If you do not wish to share home directories, remove that section.
Also how do you stop samba?
You stop samba the same way you stop most daemons -- run its init script with a "stop" parameter:

Code: Select all

/etc/rc.d/rc.samba stop
Jonathan

User avatar
KaYnemO
Posts: 26
Joined: Mon 05 Dec 2005, 16:34
Location: Moscow, Russia

Samba

#15 Post by KaYnemO »

Hiya!
Thanx for the support. After some tweaking Samba is up and running well and sharing the folder which I needed and NOT root. It was eating up 100% of CPU, but after a reboot things returned to normal. So thanks again for all support.
...don't you wish you could "undo" in real-life sometimes?...

SamSung
Posts: 96
Joined: Fri 14 Oct 2005, 17:50
Location: France

#16 Post by SamSung »

Hi

I have installed the Samba server dotpup and everything works fine, apart from

If I try to install any other package the pup get manager tries to uninstall the samba dotpup as noted in this thread, can I edit something to stop this from happening.

Also I would like to automatically mount the smb shares setting the option to do so in LinNeighbourhood does not work and I cannot seem to get the command

Code: Select all

# mount -t smbfs //Server/Documents /root/mnt/Server/Documents
to mount the drive either I get the error

Code: Select all

mount: Mounting //Server/Documents on /root/mnt/Server/Documents failed: Invalid argument

Anyone any ideas.
I am using 109CE

Cheers

Sam

User avatar
daftdog
Posts: 120
Joined: Thu 22 Jun 2006, 00:47
Location: Western Australia

#17 Post by daftdog »

I was having the same trouble with samba-3.0.21c being removed whenever I used Pupget. I tried deleting the line beginning Samba in /root/.packages/packages.txt and the next time I used Pupget it didn't try to remove Samba and now samba-3.0.21c shows up as an installed package in the right-side window of the pupget package manager.

gjhicks
Posts: 5
Joined: Mon 20 Jun 2005, 23:40
Location: World's Most Liveable City

#18 Post by gjhicks »

Hi,

Whoops! Made a post that seemed really sensible until I noticed that the 'user' setup is different than other distros I have used.

So, the below is still correct but doesn't allow write access to the "scratch" area on the puppy server. Will correct when I have a solution to this aspect.


Not sure if this is the right place to make these comments but:

Some hints on using samba with user security and WinXP clients, specially when the WinXP user names are in a form that linux/samba don't like, eg a WinXP user name like 'John Doe' - the space is a problem.

While not pretending to be an expert in either WinXP or samba, I have discovered (after much googling, etc) that there is an easy way for WinXP clients to access a samba share.

1) For each WinXP user, create a new user in puppy. Just use <adduser newusername> and ignore the errors about no home folder, just setting up a linux username/password is all that is required. Use the same passwords that the WinXP users use in WinXP - maybe this is not necessary, but it is easier than having to remember yet another set of passwords! This information is stored in a file called /etc/passwd. You can 'cat' this file to confirm that the new users have been added.

2) Set samba users for each of the newly added linux users, with the same username/password pairs, with <smbpasswd -a newusername>. This information is stored in a file called /etc/samba/private/smbpasswd. You can 'cat' this file to confirm that the new users have been added.

3) Create, in the /etc/samba/private folder a text file called "username.map". Using a new line for each pair, enter the linux/samba user names and their corresponding WinXP user names, eg:

johndoe = "John Doe"
alice = "Alice in Wonderland"
puppy = "Puppy in WinXP"

4) Add to the "Global" section of the "smb.conf" file the following two lines (the first should not really be necessary but just in case..):

smb passwd file = /etc/samba/private/smbpasswd
username map = /etc/samba/private/username.map

#This assumes that you are using "user" rather than "share" security
security = user

#And, for WinXP users, add the following line:
encrypt passwords = yes

Hope that this is of some use.

Geoff

User avatar
cobelloy
Posts: 204
Joined: Mon 23 May 2005, 07:12
Location: Karratha W.Australia

#19 Post by cobelloy »

well - i didnt see that last post, it might have been helpful today

anyway I have set up my puppy pc to be a file aand printer server for windows clients, no ftp necessary - I think it is similar to above but anyway look here - this is what I did:

http://www.murga.org/~puppy/viewtopic.php?p=62848#62848[/url]

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#20 Post by disciple »

EDIT - Problem solved by a reboot

Post Reply