Saturday, November 29, 2008

Swat in Samba

SCENARIO: Configure a SAMBA Server on RHEL5 with a NETBIOS name STATION2-NIX. Create a SHARE in it having name STATION2-RHEL5-VM and mapped to the directory /network-places/station2. Windows Machine workgroup being WORKGROUP. The share should be writeable to the user "root"


Before you configure SAMBA SERVER make sure following packages are installed:

The easiest way to configure SAMBA server is to use samba-swat utility. By default it is turned off. First check whether it has been bind to port 901 or not using:
#cat /etc/services | grep swat

After this you need to start the swat service. Use #system-config-services and check mark "swat". Save the changes and closed the window.

Open a web-browser and type the link given below:

It will ask for username and password. It's always advisable to login with root credentials. You will presented with a Web Based GUI.

Configuring a SAMBA server is just a 3 step process:

STEP 1: Go to "GLOBAL" section. Change the workgroup to the workgroup being used by Windows Machine. It can be anything like MSHOME, MYWORKGROUP,MYGROUP etc. But both Windows and Linux should use the same workgroup name. In my case workgroup="WORKGROUP". Change the netbios name to "STATION2-NIX". Change the security to "USER". Commit the changes.

STEP 2: Go to "SHARES" tab. Create a new share having the name "STATION2-RHEL5-VM". Set the path to "/network-places/station2". Make sure this directory path exits. Also make sure "browsable" and "available" options are set to yes. Add the user "root" to "write list". Commit the changes.

STEP 3: Go to the "PASSWORD" section. For the user "root" set the password and click "Add New User". You can now verify that a new entry must have been added to /etc/samba/smbpasswd. Start the smb service.
#service smb start

You all set to access the Linux Machine from Windows. Just go to Windows Box and your share would be browsable in "My Network Places"(XP) or "Network"(VISTA). Just double click the icon having you netbios name and login using "root" credentials.