کد:
http://articles.techrepublic.com.com/5100-10878_11-6180959.html
Takeaway: Even if Windows rules the desktop in your organization, you can still use Linux as a file server in the background. All it takes is installing Samba. Rather than fighting with samba.conf text files, Jack Wallen shows how to get the job done with the YaST installer in SuSe Linux.

This article is also available as a TechRepublic download.


If you deploy a Linux-based machine to serve up files in a Windows network, you're not going to get very far without the help of Samba. Samba is an Open source software suite that offers seamless file and print services to SMB/CIFS clients. Basically, Samba can fool a Windows machine into thinking a Linux machine is a Windows machine A bit of trickery yes, but it gets the job done.
Before YaST, the real trick was getting Samba to actually work. Configuring Samba required hand-editing the smb.conf file; this could be a nightmare. Now you can point-and-click your way to getting Samba running, because the good people at Novell and SuSE have worked hard to bring the Linux administrator the YaST (Yet another Setup Tool) to help. This tool makes setting up a plethora of system settings as simple as it gets. Here's how it works.
Author's note:

Our environment for this article will be OpenSuSE 10.2 and the GNOME 2.16 environment. Both are stable, robust, and very user-friendly. The installation of SuSE 10.2 was a complete install (read: five CDs full of software), so everything needed to set up a complete server is there. I highly recommend this method so you do not have to fight with dependencies should you have to install a piece of software for your server. The five-disc installation will leave you with everything you need to set up a Samba server.
Before we move on, let's make sure we all know what Samba plays with. Samba's magic happens thanks to a protocol suite known as the Common Internet File Sharing (or CIFS) at port 3020. At the heart of this protocol suite is the Server Message Block (SMB) protocol. Samba is simply the open source implementation of the CIFS protocol suite. Samba allows Linux servers and workstations to talk to any Windows workstation, all the way back to Windows 95.
A quick look around YaST

Although it is contrary to what many Linux admins would advise, I'm going to log into my SuSE 10.2 machine as root for this setup. I don't do this often, but it saves me from having to enter the root password each time I perform an administration task. Once you are done setting up these services, log out.
The first thing you'll want to do is to select the Computer menu, as seen in Figure A.
Figure A

The new GNOME 2.16 menu is quite a change from the usual cascading menu. From the menu, select Control Center, as shown in Figure B.
Figure B

The Control Center is grouped in both Groups and Common Tasks. From the Common Tasks section, select Administrator Settings to open the YaST Admin Tool. You'll see a screen similar to Figure C.
Figure C

It should be obvious that Network Services is your next destination. Select Network Services to reveal a listing of the various Network Services that can be configured from within YaST, as shown in Figure D.
Figure D

A nice collection of GUI tools to help you configure your Linux server. You are ready to begin the task at hand.
Configuring Samba

Press the Samba Server button and you'll see YaST's Samba GUI, as shown in Figure E.
Figure E

The first screen is Step 1 of 2 in the initial Samba setup. The first thing you have to do is enter the domain to be configured. The drop-down is a bit misleading. The default, TUX-NET, is the only option available. Simply erase that option and enter your domain. Once you have applied this, press Next to take care of the final phase of initial setup as shown in Figure F.
Figure F

If your server is to house all of the Samba log-in information, set it as the PDC. This final phase requires you to decide if your Samba server will act as a Primary Domain Controller. Make your selection and press Next.
Once you press Next, you can't come back to this portion of the setup without aborting the installation altogether. So make your choices wisely.
After you press Next, you are in the primary Samba configuration, as shown in Figure G.
Figure G

If you click Abort, the Samba GUI will go away. The first configuration is the Samba startup status. You can either configure Samba to start at boot or to be manually started. I highly recommend you have Samba start at boot. It will slow your boot time down a fraction of a second, but it will lessen the tasks you must handle once the server is up and running.
Once you have Samba's boot configuration taken care of, open up the firewall for Samba. Select the Open Port In Firewall check box. If your machine has more than one network interface, press the Firewall details button to apply the firewall changes to the correct interface.
The next step is to configure the proper Samba shares. Press the Shares tab, shown in Figure H, to reveal this configuration.
Figure H

You can enable or disable a feature simply by clicking the Toggle Status button. The Shares tab allows you to configure every aspect of the Samba shares. You can go beyond just enabling or disabling each share, of course. By highlighting a share and pressing the Edit button, you can further customize each share configuration.
Let's take a look at configuring the users share. Highlight that share and press Edit. A new window, shown in Figure I, reveals five pre-configured options.
Figure I

The read-only feature can protect users' files from being overwritten by other users. Obviously, the default settings will not work for most, and there are a lot of possible options to add. Let's take a look at the default options and what they are:

  • Read Only: Tells Samba if the configured shares are read only. The default is set to No. If users need only to be able to read data from the shares, highlight the option, press Edit, select the read only check box, and press OK. The share is now set to read only.
  • Comment: What users see after logging in. This could be a description of the server serving the shares.
  • Path: The directory that Samba will share out to the users.
  • Inherit ACLS: Means that all files within a parent folder will inherit the ACL (Access Control List) of the parent folder.

That's it for the default users options. Obviously, there are quite a few more options to be added.
If you press the Add button, a small window will appear with a drop-down list. That drop down list contains 124 other options to add and configure. Once you find the option you want to add, select it and press OK. Some of the new options will have another configuration window to edit before the option is added. Say, for instance, you want to add admin users. Click the drop-down and highlight admin users. You'll see the screen shown in Figure J.
Figure J

124 options to choose from. Press OK and the second window will open to enter the admin username, as shown in Figure K.
Figure K

Enter the correct username for the Samba share admin. When you press OK, you'll be taken back to the initial shares screen, but the admin user will be listed among the options. After you have completed the configuration of this section, press OK to move on.
Another option in the Shares tab is to enable to users to share their home directory. This is important: If you enable this feature, every user's home directory will be made available. If this server is used frequently by users, then privacy can become an issue. If you decide to use this feature, make sure your users are made aware of it.
Finally, the Identity tab, shown in Figure L, allows you to further specify the identity and role of the Samba server.
Figure L

Your Workgroup or Domain name should already be correct from the initial configuration. Two of the three configuration options should be familiar from earlier configurations. The final of the three, NetBIOS name is just the name the machine will be seen as on the shared network. If you want the server to be seen as "Department X" then enter Department X in this option.
You may also undertake some advanced settings from this tab. From the Advanced Settings drop-down, you can select either Expert Global Settings or User Authentication Settings. The Expert Global Settings, shown in Figure M, allow you to fine-tune settings for printing, security, and log-in.
Figure M

When you press the Edit button, the majority of the options in the Global Settings configurations are text-field entries. If you're familiar with hand-editing smb.conf files, you'll recognize a number of the configurations. One of the most important configurations you'll make here is the security option. This is how your users will authenticate to your Samba server. There are five possible settings:

  • ADS: Where Samba acts as a Domain member of an Active Directory.
  • Domain: Where Samba relies on a Windows NT Primary (or Backup) Domain Controller to authenticate users.
  • Server: Where the Samba server passes the buck of authentication to another Samba server.
  • Share: Where users only have to enter password if they try to enter a specific shared directory.
  • User: Where users are required to enter their username/password on a per Samba server basis.

The other Advanced Settings tab, User Authentication Sources, is simply a way for you to define where Samba finds the resource file to authenticate users. There are four different types:

  • smbpasswd File
  • LDAP
  • TDB Database
  • MySQL Database

Obviously, this configuration will depend completely on your network setup. The default option is smbpasswd File. If you press the Edit button (with that option highlighted), you can then enter the location of the password file used.
Ready to go

With all of these options complete, you are ready to complete the configuration by pressing the Finish button. This will save all of your configurations and start the Samba services. If your configuration is successful, you can now log into your Samba server from your Windows machines. Just connect to the Linux server from the Windows workstation in Explorer using the standard \\servername syntax




موضوعات مشابه: