Gizmo's Freeware Forum

Gizmo's Freeware Forum (https://www.techsupportalert.com/freeware-forum/)
-   Linux (https://www.techsupportalert.com/freeware-forum/linux/)
-   -   Linux as a File Server (https://www.techsupportalert.com/freeware-forum/linux/1235-linux-as-file-server.html)

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?

Cheers

Wdhpr

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

Samba
 
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)

http://home.comcast.net/~debtboy/debtboy/samba1.png

As you can see, I also installed the client utilities.
Now I'll configure using the Samba Server link in Network Services section shown.
http://home.comcast.net/~debtboy/debtboy/samba2.png

Simple graphical setup
http://home.comcast.net/~debtboy/debtboy/samba3.png

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.
http://home.comcast.net/~debtboy/debtboy/samba5.png

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.
http://home.comcast.net/~debtboy/debtboy/samba6.png

Now we will use this share in configuration.
http://home.comcast.net/~debtboy/debtboy/samba8.png

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.
http://home.comcast.net/~debtboy/debtboy/samba9.png

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)
http://home.comcast.net/~debtboy/debtboy/samba11.png

http://home.comcast.net/~debtboy/debtboy/samba12.png

NOTE:
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).
http://home.comcast.net/~debtboy/debtboy/samba16.png

debtboy 04. Jul 2009 12:00 AM

Now lets have a look...

http://home.comcast.net/~debtboy/debtboy/samba17.png

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

http://home.comcast.net/~debtboy/debtboy/smb1.png



http://home.comcast.net/~debtboy/debtboy/smb2.png



http://home.comcast.net/~debtboy/debtboy/smb3.png

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).

http://home.comcast.net/~debtboy/debtboy/smb4.png

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

http://home.comcast.net/~debtboy/debtboy/smb5.png

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:
/var/www/htdocs/index.html

http://home.comcast.net/~debtboy/debtboy/smb6.png


All times are GMT +1. The time now is 07:25 AM.

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