Gizmo's Freeware Forum

Gizmo's Freeware Forum (
-   Linux (
-   -   Linux as a File Server (

debtboy 30. Jun 2009 04:46 AM

Linux as a File Server
Many homes now have multiple computers connected together
via router/switch combinations creating small home networks.
These networks will almost always have at least one
MS Windows machine on it
(In my case 2, both of my daughters have laptops,
one w/ Vista and one w/ XP)
NOTE: my one daughter does VNC into the
Linuxbox to run Linux sessions quite often.

We also have 2 desktop machines running Linux,
one is used as the main desktop and the other
is used as a central file server among other things.

This allows me to easily manage storage, access permissions
and back-ups while allowing everyone to share files, pictures, videos, etc...

In order for the Linux server to communicate with the
Windows machines, it has to support the smb (Server Message Block)
protocol. Linux implements this by running the smb.d daemon
commonly known as a Samba server.

In my next post, I will demonstrate the installation and configuration
of the Samba Server (which comes with most every distro) as well as
setting it to automatically run on startup.

Got an older PC lying around, too slow for Vista,
install Linux and make it a file server. ;)

wdhpr 30. Jun 2009 04:58 AM

I'm looking forward to this
If i dual boot to linux than this could be helpful.

What can be done that windows based network software can not? More specifically what does linux do out of the box...that shareware can do?



peter 30. Jun 2009 05:00 AM

What's the advantage in doing this in Linux, rather than using Windows and eg. WinServer?

debtboy 30. Jun 2009 05:47 PM

The same function is obviously available using Windows shares,
in fact, by using Samba I'm actually emulating a Windows machine.

This is not a Linux vs. Windows debate, it's more like a "how to"
by using Linux.

This is the first in a series of post where I use a simple
Linux machine to accomplish various server tasks.
I plan to demonstrate a File Server,
Web / FTP Server,
Database Server,
Telnet / SSH Server,
VNC (virtual networking computing) server,
etc..., etc...
maybe even a streaming media server.

If you have additional suggestions, let me know.

I'll be posting the Samba details in the next couple of days.

debtboy 03. Jul 2009 11:06 PM

Here is a simple use of Samba on a Linuxbox (laptop in this case).

Hardware: Acer Aspire 5315
OS: openSUSE 11.1

In the following posts, I will configure Samba 2 different ways,
but in addition to these, you could always just manually edit the
/etc/samba/smb.conf file.

If Samba isn't already installed you have to install it via
package manager, source, etc... (I'm using Yast)

As you can see, I also installed the client utilities.
Now I'll configure using the Samba Server link in Network Services section shown.

Simple graphical setup

You would normally set up your Samba Server as the primary domain controller,
but in my case, I already have one (my existing Linux Server).

You will want this server to start-up during boot and you will also
need to poke a hole in your firewall.

debtboy 03. Jul 2009 11:29 PM

You will have to select a directory to share out.
I normally create a directory put it right under the /home

When an unknown user accesses this directory they
are mapped to a user called nobody, I personally
transfer ownership of the dir. to nobody (see permissions),
but that's not necessary. Keep in mind that the user nobody
has to have read/write rights.

Now we will use this share in configuration.

Your workgroup and domain controller settings will differ from mine.
The workgroup should match the name of your Windows Workgroup
and in your case is will most certainly be a domain controller.
I may even have to come back and adjust.

debtboy 03. Jul 2009 11:54 PM

Now we configure the Global Settings,
if you look at the samba config file, you will see this is the first section.
more /etc/samba/smb.conf

The first thing I change is security...
By default (and rightly so) access is granted based on the user
(this would be a Linux user account), you can duplicate accounts,
map users or just require Linux account logins, but I use this server
for central storage, it's behind a firewall and my router (NAT) so
I don't require a login. Each computer in the home network has a
permanent mapping to the storage. (we trust each other implicitly)

This allows me to set the security to SHARE. Users accessing the
storage are unknown which in turn are mapped to the user nobody and
carry the same rights as the user nobody and the user nobody has full rights
to the directory. (user security is better, but it depends on how your using it)

By using this client, I discovered that you couldn't see the Samba Share
by opening and scanning the network from the Windows side, so I added
browseable = Yes
to the bottom of the /etc/samba/smb.conf in the share section (see below).

debtboy 04. Jul 2009 12:00 AM

Now lets have a look...

debtboy 04. Jul 2009 12:07 AM

Now for the second, more universal way of setting up Samba.
We use SWAT, it's a web based configuration utility for Samba
which isn't tied to any particular Linux distribution.

We install Samba just the same, but we also install Apache and
of course mod-perl and mod-php5 while were at it :D

debtboy 04. Jul 2009 12:18 AM

Now we want to start a few of these services we just installed.
I run chkconfig to see what's running (your distro command may differ).

Then I start up what I need:
and xinetd (xinetd should automatically turn on, but why take the chance).

Now I check to see if Apache is running, of course I needed to create a page
for testing.
Your local directory for webpages should be here by default:

All times are GMT +1. The time now is 05:19 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2021, vBulletin Solutions, Inc.