Solved

Help configure SAMBA configuration for home network

Posted on 2009-05-08
5
2,804 Views
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.
0
Comment
Question by:PCBOP
  • 3
  • 2
5 Comments
 
LVL 8

Expert Comment

by:thetmanvn
ID: 24337804
Hi PCBOP

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
0
 

Author Comment

by:PCBOP
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.
0
 
LVL 8

Accepted Solution

by:
thetmanvn earned 500 total points
ID: 24342359
Hi PCBOP,

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

http://www.jonathanmoeller.com/screed/?p=901

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.

Retest
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]

samba01.png
samba02.png
samba03.png
samba04.png
samba05.png
samba06.png
samba07.png
0
 

Author Comment

by:PCBOP
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?
0
 
LVL 8

Expert Comment

by:thetmanvn
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.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

Goal:  To set up a secure SSH server for your home computer to make it accessible anywhere AND to use it as a port forwarding proxy. Steps 1.  WinSSHD version 5 is free for personal use.  So download and install it.  You can download it from the…
This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

707 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

14 Experts available now in Live!

Get 1:1 Help Now