The time now is Sat 25 May 2013, 11:49
All times are UTC - 4 |
|
Page 1 of 8 [106 Posts] |
Goto page: 1, 2, 3, ..., 6, 7, 8 Next |
| Author |
Message |
rcrsn51

Joined: 05 Sep 2006 Posts: 7758 Location: Stratford, Ontario
|
Posted: Thu 23 Sep 2010, 09:50 Post subject:
How to Use Samba-TNG Server in Puppy |
|
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:
Install the samba-tng-rcrsn-0.5-rc1.pet attached below.
Open a terminal and run: samba-start
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.
-------------------------
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:
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.
| Code: | [global]
security = user
map to guest = Bad Password |
Or you might want a read-only public folder.
| Code: | [public]
path = /mnt/home/public
guest ok = yes
read only = yes |
To let anyone write to the public folder, use
| Code: | [public]
path = /mnt/home/public
guest ok = yes
writable = yes
force user = root |
---------------------------
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.
To set up a Windows Client:
Start the Add Printer Wizard
Select: Local printer (even though it's not)
UNcheck the option to automatically detect a PnP printer
Select: Create new port
Select: Local port
Enter the port name as: \\servername\printername
Install the Windows printer driver as usual
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.
Continued in Part B farther down this thread ...
 |
| Description |
Updated 2012-06-24
|

Download |
| Filename |
samba-autostart-1.1.pet |
| Filesize |
687 Bytes |
| Downloaded |
478 Time(s) |
| Description |
Updated 2011-01-08
|

Download |
| Filename |
samba-tng-rcrsn-0.5-rc1.pet |
| Filesize |
1 MB |
| Downloaded |
2585 Time(s) |
Last edited by rcrsn51 on Mon 14 Jan 2013, 12:01; edited 187 times in total
|
|
Back to top
|
|
 |
RetroTechGuy

Joined: 15 Dec 2009 Posts: 2301 Location: USA
|
Posted: Fri 24 Sep 2010, 11:43 Post subject:
Re: How to Use Samba-TNG in Puppy |
|
| rcrsn51 wrote: | | 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.).
So I'm looking for good, secure method (either passworded, or simply denial of outside users).
What would you recommend?
|
|
Back to top
|
|
 |
rcrsn51

Joined: 05 Sep 2006 Posts: 7758 Location: Stratford, Ontario
|
Posted: Fri 24 Sep 2010, 14:14 Post subject:
|
|
A really simple method for setting up a Puppy fileserver is here.
Last edited by rcrsn51 on Mon 05 Dec 2011, 10:33; edited 1 time in total
|
|
Back to top
|
|
 |
RetroTechGuy

Joined: 15 Dec 2009 Posts: 2301 Location: USA
|
Posted: Fri 24 Sep 2010, 15:18 Post subject:
|
|
| rcrsn51 wrote: | A really simple method for setting up a Puppy fileserver is here.
If you are interested in FreeNAS, there are instructions here. |
Thanks rcrsn51, I'll look into these further.
|
|
Back to top
|
|
 |
gary101

Joined: 08 Oct 2006 Posts: 539 Location: Boston, Lincs. UK
|
Posted: Fri 24 Sep 2010, 16:42 Post subject:
|
|
Thanks rcrsn51
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.
Thanks again
Gary
_________________ If it's not one thing it's your mother
|
|
Back to top
|
|
 |
raffy
Joined: 25 May 2005 Posts: 4636 Location: Manila
|
Posted: Thu 30 Sep 2010, 19:37 Post subject:
printer |
|
| gary101 wrote: | | ..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).
|
|
Back to top
|
|
 |
rcrsn51

Joined: 05 Sep 2006 Posts: 7758 Location: Stratford, Ontario
|
Posted: Thu 30 Sep 2010, 20:57 Post subject:
Re: printer |
|
| raffy wrote: | | 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
|
|
Back to top
|
|
 |
sunburnt

Joined: 08 Jun 2005 Posts: 4006 Location: Arizona, U.S.A.
|
Posted: Sun 03 Oct 2010, 07:41 Post subject:
|
|
The Samba server was in the standard Puppy release many years ago.
I don`t know why it`s not included, it doesn`t take up much space really.
|
|
Back to top
|
|
 |
rcrsn51

Joined: 05 Sep 2006 Posts: 7758 Location: Stratford, Ontario
|
Posted: Sun 03 Oct 2010, 17:06 Post subject:
|
|
| sunburnt wrote: | | The Samba server was in the standard Puppy release many years ago. |
I think that you are mis-remembering. Puppy has contained Samba CLIENT functionality for a long time.
| Quote: | | I don`t know why it`s not included, it doesn`t take up much space really. |
MU once hosted a Samba server PET that was 20MB. And the current Wary repo has the samba-3.4.2-w5.pet at 28MB.
|
|
Back to top
|
|
 |
sunburnt

Joined: 08 Jun 2005 Posts: 4006 Location: Arizona, U.S.A.
|
Posted: Sun 03 Oct 2010, 19:31 Post subject:
|
|
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. )
|
|
Back to top
|
|
 |
rcrsn51

Joined: 05 Sep 2006 Posts: 7758 Location: Stratford, Ontario
|
Posted: Wed 06 Oct 2010, 14:22 Post subject:
|
|
[Update] The version of samba-tng-rcrsn dated 2010-10-04 can now handle network print sharing.
There are also instructions for setting up a headless, dedicated server.
|
|
Back to top
|
|
 |
rcrsn51

Joined: 05 Sep 2006 Posts: 7758 Location: Stratford, Ontario
|
Posted: Sat 09 Oct 2010, 08:03 Post subject:
|
|
How to Use Samba-TNG in Puppy - Part B
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.
------------------------------
To simplify your server setup procedure, the Samba-TNG package contains two additional items.
1. The file /usr/local/samba/etc/smb.conf.2 is a larger configuration file that has all the features discussed above. Copy it over the current smb.conf.
2. The script samba-adduser creates Samba/Linux users in one step. Run it from the command line.
Continued ...
Last edited by rcrsn51 on Sat 22 Oct 2011, 12:08; edited 28 times in total
|
|
Back to top
|
|
 |
RetroTechGuy

Joined: 15 Dec 2009 Posts: 2301 Location: USA
|
Posted: Sun 10 Oct 2010, 10:21 Post subject:
|
|
| rcrsn51 wrote: | How to Use Samba-TNG in Puppy - Part B
|
Thanks for all the hard work, rcrsn51!...
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...
_________________ Wellminded Search
Add swapfile
|
|
Back to top
|
|
 |
rcrsn51

Joined: 05 Sep 2006 Posts: 7758 Location: Stratford, Ontario
|
Posted: Sun 10 Oct 2010, 12:25 Post subject:
|
|
How to Use Samba-TNG in Puppy - Part C
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
|
|
Back to top
|
|
 |
rcrsn51

Joined: 05 Sep 2006 Posts: 7758 Location: Stratford, Ontario
|
Posted: Mon 11 Oct 2010, 10:06 Post subject:
|
|
[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
|
|
Back to top
|
|
 |
|
|
Page 1 of 8 [106 Posts] |
Goto page: 1, 2, 3, ..., 6, 7, 8 Next |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|