Printed from http://kimbriggs.com

Basic Samba Setup with No Security Suse 9.3 (Deprecated) for a Fileserver with Nightly Backups

This how-to uses Suse 9.3 and Samba 3.0.13. If you find it not working, try the newer tutorial using Ubuntu 7.04 and Samba 3.0.24.

Summary of Samba Fileserver Network Objectives

You are tired of having several copies of the same file on different computers, or figuring out which computer you have a certain file on. You have a trusted LAN, either at your home or a SOHO (Small Office Home Office) type of setup and you would like to have one central place for every person (every computer) to work off of. You may also be afraid of the Windows Home Server.

It is truly a trusted LAN and you are not concerned about security. In other words, you don't want to have to enter a username and password. You want all files to be owned by the same user on the central fileserver and be equally accessed by anybody on the network. You want it to appear that the user is working on files on the local machine.

If you have a situation similar to the above, I recommend you do like the big enterprise corporations and use linux where it is well suited and completely ready for use, as a central fileserver. This setup has saved me lots of time, some money and prevented a lot of aggravation.

Requirements:A dedicated computer that you can leave on all the time, or at least will be on when any other computer in the network is being used. An extra hard drive. A linux distribution containing the Samba package. I have described a setup using SUSE linux (it's free). A safe minimum is Pentium III and 256MB RAM. A nice fileserver would be a P4 with 500MB RAM.

Samba Background

Samba is a an open-source software package that runs on non-MS Windows machines that lets you communicate with Windows servers and clients. It can work on linux-linux machines as well, but I'm of the opinion that the NFS (Network File System) is much better suited for that task. There is a lot of documentation on the Samba website and included in the Samba package. Go to those places if you really want to learn the details.

***Do not use this method if you are concerned about protecting sensitive data***.

The Samba package for linux/UNIX is capable of enterprise-wide file sharing and handling different types of security authentication. The default setup is, in fact, very secure and it took me a while to figure out the settings for a "wide open" sharing setup, similar to the Windows Network Neighborhood defaults. I have included a summary of the settings you need to make Samba INSECURE.

Description for "How-To" Samba Fileserver based on SuSE linux 9.x, Samba 3.0.13

Using YaST, the SuSE linux configuration tool, it is very easy to get Samba Server up and running. Then by joining the Windows workgroup for you LAN, you're almost done. The real trick comes in modifying the Samba configuration file, /etc/samba/smb.conf. First the easy stuff:

Initial setup of linux samba fileserver and Windows samba cha-cha-cha client.

  1. Linux Server: You need to have the Samba package installed (Yast -> Install Software).
  2. YaST -> Network Services -> Samba Server.
  3. Startup Tab = "On".
  4. Identity Tab: Fill in Workgroup = "workgroup_name".
  5. In a user's home directory, create directories within it that you want to share (My ex: documents, photos, music).
  6. Windows: Right-click "My Computer" -> Properties -> Computer Name -> Change -> Workgroup = "workgroup_name".
  7. See below for remaining options.

It is possible to complete the setup using Yast. You can go to the "shares" tab and enter values for each option on each share using the drop-down menu, but it is a lot easier to copy and paste your settings directly into the /etc/samba/smb.conf file. Here is an excerpt from mine of what I think is important in the "global" section and a examples from the shares themselves. Make sure you make a backup of this file, by calling it smb.conf_ORIG or something and only work on the new one.

If something is already in the global section, you can leave it there without harm, but if you have any of these settings below, make sure you change them and don't make duplicates. The other entries are complete "shares" and can be used as-is. Make sure you replace the values in quotes with your values and don't include the quotes. Let me know if I left out a required global setting. Thanks.

[global](partial)
workgroup = "workgroup_name"
restrict anonymous = no
server string = "server_alias"
security = share

[documents]
path = /home/"user_name"/Documents/
guest ok = yes
read only = no
case sensitive = no
msdfs proxy = no
force user = "user_name"
force group = "users"
force directory mode = 0755
force create mode = 0755

[music]
path = /home/"user_name"/music/
guest ok = yes
read only = no
force user = "user_name"
force group = "users"
case sensitive = no
msdfs proxy = no
force directory mode = 0755
force create mode = 0755

[photos]
path = /home/"user_name"/photos/
guest ok = yes
read only = no
force user = "user_name"
force group = "users"
case sensitive = no
msdfs proxy = no
force directory mode = 0755
force create mode = 0755

[website]
path = /home/"user_name"/public_html/
guest ok = yes
read only = no
force user = "user_name"
force group = "users"
case sensitive = no
msdfs proxy = no
force directory mode = 0755
force create mode = 0755

To make things simple: On your Windows clients, you should automatically be able to see the shares through "My Network" (Network Neighborhood). To make the files easier to access, I suggest you create shorcuts within your "My Documents" folder that is usually on the desktop. I think I remember having problems, however, substituting the actual directory "My Documents" with a shortcut. Windows kind of told me I didn't want to do that, but I was able to delete and recreate "My Music" and "My Pictures" as shortcuts to the fileserver's directories, but the name has to be exactly the same, or else Windows will keep re-creating them for you. The only drawback to this is that you will have a shortcut something like "My Documents\documents", which could mean an extra click at times. On the other hand, it helps to "cleanup" the My Documents folder into a few, high-level directories.

Ex: Open up My Documents -> Empty My Pictures (because you've already got them on your fileserver, right?) and delete it -> Click File...New Shortcut -> Use the wizard to browse to the folder on the network that you want (e.g., photos) -> If it doesn't give you an opportunity to rename it, right-click the new shortcut and rename it "My Pictures".

To arrange nightly backups:

  1. Add the extra hard drive to the linux file server.
  2. Choose a nice and easy "mount point" (location) for it like "/backup".
  3. Make it writeable for the user (as root): chown -R "user_name" /backup.
  4. Create a text file (shell script) to execute the rsync program for each directory (see below).
  5. Schedule a cron job to run nightly and execute the shell script.

Contents of shell script "backup.sh". You need the trailing slash for the first location.

rsync -av /home/"user_name"/Documents/ /backup/documents
rsync -av /home/"user_name"/photos/ /backup/photos
rsync -av /home/"user_name"/music/ /backup/music
rsync -av /home/"user_name"/public_html/ /backup/website

Check the backup directory once in a while to clean up deleted files you are SURE you don't need. The -av options do NOT delete files. They update existing files to newer versions and add files not yet in the backup folder.

It is hard to describe how much easier computer networking / maintenance has been since I installed this setup. I don't have any special interest in rsync or Suse linux, but they have proven to be really good products. You can even set the YOU program (Yast Online Update) to work automatically every night. Now I just need a script to synchronize my "bookmarks" files and I'll be all set...

Buy gold online - quickly, safely and at low prices

 
CC License Ubuntu OpenOffice GIMP Graphics Geany Editor Firefox php.net Play Ogg what's this?