Help configure SAMBA configuration for home network

Posted on 2009-05-08
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

3.Use this link as your refrence for create share and ACLs

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 500 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Best Linux Distro for this software 10 63
hosting email transfer 3 43
Ransomware attacks 5 82
route 2 traffic streams on single NIC 6 34
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…
Have you ever stumbled upon a software that is so great that you just love? It happened to me. Love at first sight. Filezilla Server.   Ok its not the most advanced ftp server I've came across. But its a fairly simple piece of software to get the …
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

929 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now