Update: Samba-TNG has proven to be a robust Samba server for Puppy. But it doesn't work with some modern devices like Android tablets or smartphones. As an alternative, I have packaged a basic version of Samba4 in a PET. The discussion about Samba4 Basic starts here.

---------------------------

In order for a Puppy machine to share its files across a network, it must run some kind of server. This could be an FTP or HTTP server, but the most versatile choice is Samba. Samba can be used to make a simple NAS file sharing box or to build a full multi-user client-server system.

Samba-TNG is a fork of the official Samba project. It is much smaller and is satisfactory for home networks. Here are the setup instructions:

The server's name is pupserver and the share's name is pupshare. The default user is root with password woofwoof. The share is currently set to the server's /mnt/home folder and is writable by clients.

Depending on your Puppy installation method, you may not have a /mnt/home folder. If so, edit the smb.conf file (see below) so that pupshare points to an existing folder. For test purposes, just use /root.

-------------------------------

Please note: Running the Puppy firewall on a Samba server machine will block it from clients. If you really want to run a firewall, you must do a custom install that opens the following ports: 135/tcp 137/udp 138/udp 139/tcp 445/tcp.

-------------------------------

From a Puppy client, you can access the server with Pnethood. For a faster share mounting tool, look at YASSM. If the client machine is using a recent 3.x kernel, please see the note in YASSM regarding the sec=ntlm option.

-------------------------

On a Windows client, create a shortcut on the desktop and make the location \\pupserver. Note that this name starts with two back-slashes.

The Puppy server's default workgroup name is pupgroup. Depending on the version of Windows, you may need to change the workgroup name in smb.conf (see below) to match that of your Windows clients. Some common names are WORKGROUP or MSHOME.

---------------------------

The server's configuration file is /usr/local/samba/etc/smb.conf. You can edit it to change the share folder or to add additional shares.

After editing the smb.conf, stop the server with samba-stop and restart it with samba-start.

A useful command when working with Samba is ps. You should see the group of ten Samba daemons running.

Avoid making changes to the server while clients are connected. This can cause hangups that will require rebooting to clear. If Samba starts to behave strangely, shut down any client machines and restart the Samba server.

----------------------------------

The Samba-TNG package contains the utility program rpcclient. Use it to create additional Samba users. For example:

Code:

rpcclient
$help
$enumusers
$createuser spot -p barkbark
$quit

Any new Samba users you create must already exist as Puppy users. Also, Samba must be running in order for rpcclient to work.

In the above default configuration, all the shares you create are public. But you might want to give each user their own private folder on the server. Here's how:

1. Create a Puppy user named Fred:

Code:

adduser -D -h /mnt/home/fred fred

2. To verify that you have made Fred's account correctly, type:

Code:

ls -lH /mnt/home

There should be an entry for fred with fred:fred ownership. If you make a mistake, type deluser fred and try again.

3. Create Fred as a Samba user with rpcclient. Note that the Samba user Fred requires a password, but the Puppy user Fred does not.

4. Add an entry to smb.conf:

Code:

[fred]
path = /mnt/home/fred
writable = yes
valid users = fred

5. Restart the Samba server, go to a client machine and login as Fred.

------------------------------

You may want a setup where no initial login is required. Open your smb.conf and uncomment the "map to guest" line by removing the semicolon.

To auto-start the Samba server at bootup, install the samba-autostart-1.1.pet below. It puts a script in /root/Startup that waits until your network is active, then runs samba-start. You can also use the script to mount any drives that you want to share.

Or you can try adding the script to your rc.local. Then you could boot Puppy with the "pfix=nox,fsck" argument and run headless! And, if you don't mind working from the command line, you can install Openssh on the server and manage it remotely.

-------------------------

Samba keeps its own set of passwords - it doesn't care about the Puppy versions. So you might want to change the Samba server root password to something more secure than "woofwoof".

Code:

rpcclient
$deluser root
$createuser root -p newpassword
$quit

-----------------------------

Using Samba-TNG as a Network Print Server

Note #1: To enable print sharing in newer Puppies like Lupu, you must make a change to the smb.conf. In the [global] section, locate the line printcap name = cups and uncomment it by removing the semicolon.

Note #2: If your Puppy server is running CUPS 1.3.11, you need to modify its configuration. Locate the file /etc/cups/mime.convs. At the end of the file, uncomment the line

Code:

application/octet-stream application/vnd.cups-raw

Restart CUPS.

A Samba server can share its attached printer(s) with clients on the network. And it does so by the printer's assigned name instead of by IP address. So if your server changes its IP address, the clients can still locate the printer.

Your first step is to install the printer in the server's CUPS as a local device. Keep the name short - less than 16 characters. Otherwise, the Windows clients may not be able to detect it.

You do NOT need to declare the printer as sharable. (You would only use that feature if CUPS was going to handle the network printing.)

Whenever you make changes to your printer setup, restart Samba to ensure that the printers will be visible on the network.

There is one small catch to this setup. If you have enabled initial logins, then a Windows client MUST login to access the printer. However, a Puppy client can use the printer without logging in.

To set up a Linux Client:

Users who have set up Windows shared printers are familiar with the CUPS smb backend. This type of backend is also needed to access a Samba printer and there are several variations available in different Puppies. Use the URI:

Code:

smbc://pupserver/printer_name

When you select the make and model of your printer, use Raw and Raw-Queue. This declares that the print job will be sent directly to the Samba server, whose CUPS will then do the formatting. You don't need to install a printer driver package on the client machine. However, in certain Puppy client/server combinations, this may still be necessary.

Some Windows drivers may not work across a network because they need to have direct contact with the printer before they will start a print job. In that case, install the printer under Windows as an HP Color Laserjet PS. This will format the print job using the Postscript printer language, which the server's CUPS will happily process. You can use the same technique with Macs.

-------------------------------

If you are building a dedicated file server and want very simple print server functionality, read here.

I am not personally interested in Samba - there are simpler ways to have Puppy serve up some files.

OK, I'll bite! How would you serve up files? (I'm currently looking at FreeNAS, but haven't tried it yet).

I'd like to plug my (new, soon to be created) file server into my wireless DSL router, with the ability to deny outside users access to these files (I have not decided if I wish to allow non-local users access to any files on the machine -- that may depend on how hard it is to secure, etc.).

Great timing! I was just looking in to setting up a print and file server on an old laptop I was looking for a use for.

Using the posted pet and start up file I was up and running in less than 10 mins and everybody here is really pleased to have somewhere on the network to share and backup their files and printing is now so much simpler rather than transferring the files to the computer with the printer installed.

I have had this old lifebook 700mhz lappy for a couple of years and it cost me £10 on ebay, its not much use for anything else but is now doing a really useful job.

..printing is now so much simpler rather than transferring the files to the computer with the printer installed.

Do you mean "Windows machines can now print to the server"? I thought that when configured, CUPS already enables Linux machines to print through the network._________________Puppy user since Oct 2004. Want FreeOffice? Get the sfs (English only).

I thought that when configured, CUPS already enables Linux machines to print through the network.

In a Samba setup, the CUPS printers hosted by the server are advertised by their assigned names. This is a good thing, because a client does not need to reinstall its printer if the server's IP address changes.

However, I could not get this to work with Samba-TNG, so I removed all the printing components.

A client, either Linux or Windows, can still see the Puppy server's printers as described here.

Update The 2010-10-04 release of samba-tng-rcrsn now has full print sharing capability.Last edited by rcrsn51 on Mon 04 Oct 2010, 22:48; edited 3 times in total

rcrsn51; No... In fact it was included in a release or two back in Puppy2xx.
The 2 library files "smbd" and "nmbd" which make the Samba server work,
are less than 2 mb. ( I think, it`s been awhile and they may be bigger now. )

If you have many users, adding individual share entries to your smb.conf becomes awkward. A better approach is to use the following entry instead:

Code:

[homes]
writable = yes
browseable = no

This works because [homes] acts as a virtual share. Once a user has logged in, Samba maps [homes] to the user's actual Linux home directory on the server.

In the example in Part A above, you created a Linux account for Fred. At the moment, his home directory has Linux read permission for other users. To give him more privacy, type

Code:

chmod 0700 /mnt/home/fred

Open your smb.conf file and add the above [homes] entry. Delete Fred's share entry and restart Samba. Login as Fred. To add more users in the future, just run adduser and rpcclient. You don't need to modify your smb.conf file.

But there's a catch. Neither Pnethood or LameSMBxplorer can detect these virtual shares. Windows can access them, but only if you have enabled initial logins. So install YASSM instead. Its samba-login tool works fine.

Enter the username and password but leave the Share field blank. You are automatically connected to the user's home directory on the server. You can login to a different share (if you have permission) by entering the username, password and share name.

If you have configured no-login access, you can open a public share just by entering its share name.

----------------------------

To complete your Samba server, you will probably want a common upload area where users can share their files.

1. Create the shared folder and give it a full set of permissions.

Code:

mkdir /mnt/home/upload
chmod 1777 /mnt/home/upload

2. Add an smb.conf entry

Code:

[upload]
path = /mnt/home/upload
writable = yes

All users have permission to write to the share. They can read each other's files but cannot delete them.

I haven't gotten a chance to try it, but it looks like every day I dawdle, it improves!

I have an old "toaster" that I plan to turn into a fileserver, but based on what I'm seeing here, I think I'll also try to make it a print-server at the same time..._________________Add swapfileWellMinded Search

There's definitely a learning curve to Samba. But once you get it configured, it's easy to manage and quite robust. This is an effective way to turn single-user Puppies into a multi-user, password-protected network.

------------------------------

To simplify the procedure, here is a recipe for installing Samba:

1. Get Puppy working on your server machine, including any CUPS printers that are attached to it. Use a frugal install.

2. Install the samba-tng-rcrsn-0.5-rc1.pet and the larger smb.conf file.

3. Run samba-start

4. Run samba-adduser and make your user accounts.

5. Create an account called "public". Do NOT give it privacy.

6. Create the "upload" folder as described in Part B. Do NOT make an account for it.

7. Do NOT touch your current "root" account for now. It is already configured correctly.

8. On each client machine, install YASSM. Make a desktop shortcut for samba-login.

9. Modify the samba-login data to match the user and set it as the default.

10. Install the Samba shared printers.Last edited by rcrsn51 on Tue 06 Dec 2011, 10:58; edited 27 times in total

[Update] You can password protect your Samba printers by removing the "guest OK" entry. However, you will then need a different CUPS smb backend that allows authentication. Read here about smbw.Last edited by rcrsn51 on Mon 28 Nov 2011, 11:12; edited 1 time in total

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou cannot attach files in this forumYou can download files in this forum