Go Premium for a chance to win a PS4. Enter to Win


Help configure SAMBA configuration for home network

Posted on 2009-05-08
Medium Priority
Last Modified: 2013-12-02
I have a computer that is permanently on as a NAS fileserver, and as a printserver.
Ubuntu 9.04 is the OS. The printer is installed correctly.  We have several computers, either with Windows or Linux.

I would want a Samba configuration that
 a) shares the printer to windows and linux users, they can print with it how they want.
(ATM this works)

b) gives everyone of us (5 people) a share that only we can access.  I prefer this one has nothing to do with the NetBIOS name of the computer, but that you need to login with a username and password. (so it doesn't matter what pc you use to login with)
Also, in the event something goes wrong on the system, we should be able to recover those files (is this possible if the shares are password protected?)

c) gives a public share that everyone can access and write to.
Question by:PCBOP
  • 3
  • 2

Expert Comment

ID: 24337804

1. First, if you are not familiar with console, you can install swat (apt-get install swat) to configure samba via Web GUI

2. Use this link to config printer sharing http://tldp.org/HOWTO/Debian-and-Windows-Shared-Printing/sharing_with_windows.html

3.Use this link as your refrence for create share and ACLs http://samba.org/samba/docs/man/Samba-HOWTO-Collection/AccessControls.html

Author Comment

ID: 24338023
I found Swat, but I have the same problem as with your other links: it's over my head, too complicated for me. I have no idea exactly what I'm doing. I would prefer some very simple explanations, or sample layouts that fit my needs.

Accepted Solution

thetmanvn earned 2000 total points
ID: 24342359

Sorry for late responding,

Ok, so I can demo for you a test share. because my home haven't got printer, but you can use this guide for sharing printer


Then I will let you go through make share folder as you 2nd and 3rd question by swat for easy looking in Ubuntu 8.04 (as same as on Ubuntu 9.04)

1./ First install swat (apt-get install swat) and install smbclient for testing in Ubuntu apt-get install smbclient

2./ Start inetd by /etc/init.d/openbsd-inetd start

3./ Go to http://yourubuntuip:901/ and login with your Ubuntu root user

4./ Configure Some Global Parameter as in samba01.png (Be sure to click Commit changes)

Test your first start by using and use see what we change in SWAT is showed here

root@test:~# smbclient -U% -L localhost
Domain=[HOMENETWORK] OS=[Unix] Server=[Samba 3.0.28a]

        Sharename       Type      Comment
        ---------       ----      -------
        IPC$            IPC       IPC Service (home server (Samba, Ubuntu))
        print$          Disk      Printer Drivers
Domain=[HOMENETWORK] OS=[Unix] Server=[Samba 3.0.28a]

        Server               Comment
        ---------            -------

        Workgroup            Master
        ---------            -------
        WORKGROUP            COMPUTER_1

5. Create your first share for everyone can access and write to as in samba02.png
Before to do in samba02.png make sure you create the path with full permission to everyone
root@test:~# mkdir /home/Public
root@test:~# chmod 777 /home/Public/

In share menu, type Public in Create Share and Press Create, then you have all parameter for configuration for this share. Just config as in samba02 and you will have public share for everyone with write permission (Dont remember to click commit changes)
Retest with smbclient
root@test:~# smbclient -U% -L localhost
Domain=[HOMENETWORK] OS=[Unix] Server=[Samba 3.0.28a]

        Sharename       Type      Comment
        ---------       ----      -------
        IPC$            IPC       IPC Service (home server (Samba, Ubuntu))
        Public          Disk      Share for everyone     <------------- You see this new created share
        print$          Disk      Printer Drivers
Domain=[HOMENETWORK] OS=[Unix] Server=[Samba 3.0.28a]

6. Create 5 unix user in system, 1 group 5boss
root@mail:~# groupadd 5boss
root@test:~# useradd user1
root@test:~# useradd user2
root@test:~# useradd user3
root@test:~# useradd user4
root@test:~# useradd user5
root@test:~#mkdir /home/5Boss
root@test:~# chown root:5boss /home/5Boss/
root@test:~# chmod 770 /home/5Boss/   <----  (2 lines to allow users in 5boss group have full permision to physical folder)
root@test:~# usermod -a -G 5boss user1 (Use can do it in the useradd command but I split it out for you to easy to understand)
root@test:~# usermod -a -G 5boss user2
root@test:~# usermod -a -G 5boss user3
root@test:~# usermod -a -G 5boss user4
root@test:~# usermod -a -G 5boss user5

7. Create 5 users for your need share as in samba05.png

8. Create a share for this 5 users in samba06.png
In this screenshot, I give all option for you to see, not all option at all. You can you a valid users option is enough for simple use.

root@test:~# smbclient -U% -L localhost
Domain=[HOMENETWORK] OS=[Unix] Server=[Samba 3.0.28a]

        Sharename       Type      Comment
        ---------       ----      -------
        IPC$            IPC       IPC Service (home server (Samba, Ubuntu))
        5Boss           Disk      Share for 5 user only    <---- New Share
        Public          Disk      Share for everyone
        print$          Disk      Printer Drivers
Domain=[HOMENETWORK] OS=[Unix] Server=[Samba 3.0.28a]


Author Comment

ID: 24343053
This works perfectly! I have one more question, if I want to have a separate private folder for each user, is it enough to do this:

chown root /home/user1
chown root /home/user2
chown root /home/user3
chown root /home/user4
chown root /home/user5

and then follow samba6.png for every private share.

If something goes wrong, I suppose you just need to go root, and then you can access the files which are normally private, is that right?

Expert Comment

ID: 24344054
Yes, if you want private for each user, you can use this as home folder of each user.

then you should

chown user1 /home/user1 and chmod 700 /home/user1  (It means only user1 have full access to this folder, group user and other cannot)

Yes, if anything go wrong, root account can solve everything :D

Good luck.

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction People like FTP.  It's a solid, stable, robust protocol for quickly transferring files between two hosts using TCP/IP.  In most cases it's much faster than SMB or CIFS, and certainly much easier to set up between organizations.  This…
If you use Debian 6 Squeeze and you are tired of looking at the childish graphical GDM login screen that is used by default, here's an easy way to change it. If you've already tried to change it you've probably discovered that none of the old met…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Suggested Courses

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question